iPanda Posted January 18, 2014 Share Posted January 18, 2014 (edited) Problem solved. Edited January 19, 2014 by Guest Link to comment
iPanda Posted January 18, 2014 Author Share Posted January 18, 2014 triggerServerEvent I had to deal with this feature, but the weapon did not appear none of the factions. How to use this? Link to comment
Castillo Posted January 18, 2014 Share Posted January 18, 2014 -- server side: addEvent ( "giveWeapon", true ) addEventHandler ( "giveWeapon", root, function ( weapon, ammo, current ) if ( type ( weapon ) == "number" and type ( ammo ) == "number" ) then giveWeapon ( client, weapon, ammo, current ) end end ) And then you just trigger an event from the client side, like this: triggerServerEvent ( "giveWeapon", localPlayer, 31, 5000, true ) -- Gives a M4 with 5000 bullets and sets it as current weapon. Link to comment
iPanda Posted January 19, 2014 Author Share Posted January 19, 2014 -- server side: addEvent ( "giveWeapon", true ) addEventHandler ( "giveWeapon", root, function ( weapon, ammo, current ) if ( type ( weapon ) == "number" and type ( ammo ) == "number" ) then giveWeapon ( client, weapon, ammo, current ) end end ) And then you just trigger an event from the client side, like this: triggerServerEvent ( "giveWeapon", localPlayer, 31, 5000, true ) -- Gives a M4 with 5000 bullets and sets it as current weapon. Everything works. Now I know how this feature works, thank you! 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