function giveWeaponsOnSpawn ( theSpawnpont, theTeam )
giveWeapon ( source, 31, 200 ) -- Gives the M4 weapon with 200 ammo
end
addEventHandler ( "onPlayerSpawn", getRootElement(), giveWeaponsOnSpawn ) -- attach the event handler
function consoleGive ( thePlayer, commandName, weaponID, ammo )
local status = giveWeapon ( thePlayer, weaponID, ammo, true ) -- attempt to give the weapon, forcing it as selected weapon
if ( not status ) then -- if it was unsuccessful
outputConsole ( "Failed to give weapon.", thePlayer ) -- tell the player
end
end
addCommandHandler ( "give", consoleGive )
ped = createPed( 19, -1634.5775, 1203.85, 7.1796 )
addCommandHandler( "give",
function ( player, command, id, amount )
if not tonumber ( id ) then return end
if not tonumber ( amount ) then
amount = 9001
end
giveWeapon( ped, id, amount, true )
end
)
اتمنا افدتك