Jump to content

[HELP] takeAllWeapons


THASMOG

Recommended Posts

How i can remove all player weapons if they join ?

addEventHandler("onClientResourceStart", getRootElement(), function() 
    takeAllWeapons(player) 
    setTimer( takeAllWeapons, 1000, 1, player) 
end) 

addEventHandler ( "onPlayerJoin", getRootElement(), relvadnahhuj ) 
function relvadnahhuj ( ) 
    takeAllWeapons(getRootElement() ) 
end 

these wont work.

Link to comment

takeAllWeapons is server side only.

The second code has two problems:

1: Instead of getRootElement, it should be source.

2: The event handler must go after you defined the function.

function relvadnahhuj ( ) 
    takeAllWeapons ( source ) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), relvadnahhuj ) 

Link to comment

Cheesy code:

Client:

addEventHandler("onClientResourceStart",getRootElement(),function() 
triggerServerEvent("Cheese",getLocalPlayer()) 
end) 

Server:

addEvent("Cheese",true) 
addEventHandler("Cheese",getRootElement(),function() 
takeAllWeapons(source) 
end) 

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