xJ4ckk Posted January 28, 2017 Share Posted January 28, 2017 ------ client ------ addEventHandler ( "onClientPlayerDamage",root, function () if getElementData(source,"invincible") then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill",localPlayer, function (targetPlayer) if getElementData(targetPlayer,"invincible") then cancelEvent() end end) ------ server ------ function noDeathmatch(thePlayer) if getElementData(thePlayer,"invincible") then setElementData(thePlayer,"invincible",false) setPlayerHudComponentVisible(thePlayer,"weapon",true) setPlayerHudComponentVisible(thePlayer,"ammo",true) toggleControl(thePlayer,"next_weapon",true) toggleControl(thePlayer,"previous_weapon",true) toggleControl(thePlayer,"fire",true) toggleControl(thePlayer,"aim_weapon",true) toggleControl(thePlayer,"vehicle_fire",true) toggleControl(thePlayer,"vehicle_secondary_fire",true) outputChatBox("#ffffff[DEATHMATCH] #ff6464You have disabled the no deathmatch mode.",thePlayer,255,255,255,true) else setElementData(thePlayer,"invincible",true) setElementHealth(thePlayer,1000) setPedArmor(thePlayer,100) setPedWeaponSlot(thePlayer,0) setPlayerHudComponentVisible(thePlayer,"weapon",false) setPlayerHudComponentVisible(thePlayer,"ammo",false) toggleControl(thePlayer,"next_weapon",false) toggleControl(thePlayer,"previous_weapon",false) toggleControl(thePlayer,"fire",false) toggleControl(thePlayer,"aim_weapon",false) toggleControl(thePlayer,"vehicle_fire",false) toggleControl(thePlayer,"vehicle_secondary_fire",false) outputChatBox("#ffffff[DEATHMATCH] #ff6464You have enabled the no deathmatch mode.",thePlayer,255,255,255,true) end end addCommandHandler("nodm",noDeathmatch) i am working on a no deathmatch script but can anyone help me with this please ----> If a player set a weapon on the F1 panel that he does not get the weapon Link to comment
xJ4ckk Posted January 29, 2017 Author Share Posted January 29, 2017 Please guys i need a function to the destroy my weapon when I set a weapon Link to comment
Function Posted February 9, 2017 Share Posted February 9, 2017 (edited) Can you explain it better please, I think I need to start with a new function right? Edited February 9, 2017 by Function 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