Ruma Posted March 20, 2011 Share Posted March 20, 2011 Hi i want to ask how its possible to give weapons to a ped? i know the comand must be giveWeapon but it doesn´t work, this is the default MTA Wiki example i tryed to adapt it to an eventHandler but i cant. Can someoneExplain me how? 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 ) Link to comment
Castillo Posted March 20, 2011 Share Posted March 20, 2011 Show us your addEventHandler code. Link to comment
Ruma Posted March 20, 2011 Author Share Posted March 20, 2011 I used makePed instead of an eventHandler makePed (120,0,0,5,31,200) function makePed (skin,x,y,z,id,amount ) if not tonumber ( id ) then return end if not tonumber ( amount ) then amount = 500 end ped = createPed (skin,x,y,z) giveWeapon(ped, id, amount, true ) end Link to comment
CrazyDude Posted March 20, 2011 Share Posted March 20, 2011 I used makePed instead of an eventHandler makePed (120,0,0,5,31,200) function makePed (skin,x,y,z,id,amount ) if not tonumber ( id ) then return end if not tonumber ( amount ) then amount = 500 end ped = createPed (skin,x,y,z) giveWeapon(ped, id, amount, true ) end You must declare function first, and then call it 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