KariiiM Posted February 3, 2016 Share Posted February 3, 2016 when i did, the players told me that they see ped just moving, can't see ped have any weapon. function cmdArmedPed(player,_) local x, y, z = getElementPosition(player) -- Get your position local thePed = createPed(0, x + 1, y, z) -- Create a CJ ped nearby setTimer ( function ( ped ) giveWeapon( ped, 31, 5000, true) -- Give him 5000 rounds of M4 -- Make him shoot continuously triggerClientEvent(root,"onPedShoot",root,ped) end, 100, 1, thePed ) end addCommandHandler("armedped", cmdArmedPed) Link to comment
Bonus Posted February 3, 2016 Share Posted February 3, 2016 Use onClientElementStreamIn on the triggered ped and use givePedWeapon and setPedControlState there. addEvent("onPedShoot",true) addEventHandler("onPedShoot",root, function (ped) setPedControlState( ped, "fire", true) addEventHandler ( "onClientElementStreamIn", ped, function () givePedWeapon ( source, 31, 5000, true ) setPedControlState ( source, "fire", true ) end) Edit: Its onClientElementStreamIn, not StreamedIn Update it Link to comment
AjaxFTW Posted February 3, 2016 Author Share Posted February 3, 2016 Fixed. Thx guys for your hard work. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now