THASMOG Posted March 28, 2014 Posted March 28, 2014 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.
iPrestege Posted March 28, 2014 Posted March 28, 2014 addEventHandler ( 'onPlayerJoin',root, function ( ) takeAllWeapons ( source ) end ) Server.
Castillo Posted March 28, 2014 Posted March 28, 2014 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 )
THASMOG Posted March 28, 2014 Author Posted March 28, 2014 Added into server side script. Still wont work. No errors either. i try to debug
Castillo Posted March 28, 2014 Posted March 28, 2014 You don't have any weapons when join the server, I don't see why you need this?
kevenvz Posted March 28, 2014 Posted March 28, 2014 Cheesy code: Client: addEventHandler("onClientResourceStart",getRootElement(),function() triggerServerEvent("Cheese",getLocalPlayer()) end) Server: addEvent("Cheese",true) addEventHandler("Cheese",getRootElement(),function() takeAllWeapons(source) end)
THASMOG Posted March 28, 2014 Author Posted March 28, 2014 Maybe DayZ plugin stops it to work ? But still nothing.
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