Post by sG://SaR# on Nov 13, 2015 19:26:33 GMT
Here i give you 3common scripts for shooter maps. you can edit and use as you want.
1.Song
2.Jump(for Shooter Maps)
3.Shoot(for Shooter Maps)
How To Save Script as in .lua file
Right-Click on Desktop and create New Text Document and past code into Document. Then Click File > Save As. Make sure you use this name (shoot/jump/shoot.lua)
1.Song
Add this line in meta.xml
<script src="song.lua" type="client" />
<file src="song.mp3"></file>
Press: M (Start/Stop)
2.Jump(for Shooter Maps)
Add this line in meta.xml
<script src="jump.lua" type="client" />
Press: L-sheft
3.Shoot(for Shooter Maps)
Add this line in meta.xml
<script src="Shoot.lua" type="client" />
Press: (shoot key as you have in mta bind)
Press : k (for see instructions)
Best Regard
Shlyaping Gaming
SAR
1.Song
2.Jump(for Shooter Maps)
3.Shoot(for Shooter Maps)
How To Save Script as in .lua file
Right-Click on Desktop and create New Text Document and past code into Document. Then Click File > Save As. Make sure you use this name (shoot/jump/shoot.lua)
1.Song
Add this line in meta.xml
<script src="song.lua" type="client" />
<file src="song.mp3"></file>
setRadioChannel(0)
song = playSound("song.mp3", true)
bindKey("m", "down",
function ()
setSoundPaused(song, not isSoundPaused(song))
end
)
Add your favorite song in map folder and rename with song. if you write any other name so you must replace song with your other name in .lua and meta.xml file. you can use in OS/DM/Shooter/or any other gamemode mapsPress: M (Start/Stop)
2.Jump(for Shooter Maps)
Add this line in meta.xml
<script src="jump.lua" type="client" />
function plrJump()
local theVehicle = getPedOccupiedVehicle(getLocalPlayer())
if isVehicleOnGround(theVehicle) and not isPlayerDead(getLocalPlayer()) then
local vx,vy,vz = getElementVelocity(theVehicle)
setElementVelocity(theVehicle,vx,vy,0.35)
end
end
for keyName, state in pairs(getBoundKeys("jump")) do
bindKey(keyName, "down", plrJump)
bindKey("lshift","jump", effects)
end
this script for shooter maps and its allow a vehicle to jump. If you want to change jump height so replace (0.35) as you like.Press: L-sheft
3.Shoot(for Shooter Maps)
Add this line in meta.xml
<script src="Shoot.lua" type="client" />
cLP = getLocalPlayer()
screenWidth, screenHeight = guiGetScreenSize()
function loddist()
engineSetModelLODDistance(4726, 300)
end
addEventHandler("onClientResourceStart", getRootElement(), loddist)
function cRStest()
setTimer(resourcesCheck, 10000, 1)
end
addEventHandler("onClientResourceStart", getRootElement(), cRStest)
function resourcesCheck()
if check=="done" then return
else
setTimer(cbinds, 1000, 1)
textToggle=0
check="done"
end
end
function cRS()
if check=="done" then return
else
setTimer(cbinds, 3333, 1)
textToggle=0
check="done"
end
end
addEventHandler("onClientPlayerSpawn", getLocalPlayer(), cRS)
function markers(player)
if isPedInVehicle(player) then
local vehicle = getPedOccupiedVehicle(player)
fixVehicle(vehicle)
end
end
addEventHandler("onClientMarkerHit", getResourceRootElement(getThisResource()), markers)
function cbinds()
local keys1 = getBoundKeys("vehicle_fire")
local keys2 = getBoundKeys("vehicle_secondary_fire")
if keys1 then
for keyName, state in pairs(keys1) do
bindKey(keyName, "down", cdoshoot)
end
bindKey("F", "down", cdoshoot)
cbindsText = "- Press F or the button you use to fire to shoot rockets!\n- You can shoot once every 3 seconds.\n- good luck and have fun!."
end
if keys2 then
for keyName, state in pairs(keys2) do
bindKey(keyName, "down", cdoshoot)
end
end
if (not keys1) and (not keys2) then
bindKey("F", "down", cdoshoot)
bindKey("lctrl", "down", cdoshoot)
bindKey("rctrl", "down", cdoshoot)
cbindsText = "- Press F or CTRL to shoot rockets!\n- You can shoot once every 3 seconds."
end
theVehicle = getPedOccupiedVehicle(cLP)
allowShoots()
bindKey("K", "down", toggleText)
outputChatBox("#FF3366Press K to show/hide instructions", 255, 255, 255, true)
end
function toggleText()
if textToggle==0 then
addEventHandler("onClientRender", getRootElement(), bindsText)
textToggle=1
elseif textToggle==1 then
removeEventHandler("onClientRender", getRootElement(), bindsText)
textToggle=0
end
end
function allowShoots()
bindTrigger = 1
end
function cdoshoot()
if bindTrigger == 1 then
if not isPlayerDead(cLP) then
bindTrigger = 0
local x,y,z = getElementPosition(theVehicle)
local rX,rY,rZ = getElementRotation(theVehicle)
local x = x+4*math.cos(math.rad(rZ+90))
local y = y+4*math.sin(math.rad(rZ+90))
createProjectile(theVehicle, 19, x, y, z, 1.0, nil)
setTimer(allowShoots, 3000, 1)
end
end
end
function bindsText()
dxDrawText(cbindsText, screenWidth/15, screenHeight/2.5, screenWidth, screenHeight, tocolor(0, 149, 254, 255), 0.75, "bankgothic")
end
This script for only shooter maps.You can shoot rocket in every 3secondsPress: (shoot key as you have in mta bind)
Press : k (for see instructions)
Best Regard
Shlyaping Gaming
SAR