Jump to content

Client and server side?


iPanda

Recommended Posts

-- 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
-- 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...