Function Posted February 8, 2017 Share Posted February 8, 2017 (edited) Please guys how can I destroy a weapon when a player is on nodm mode and tries to set a weapon. 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) Edited February 8, 2017 by Function Link to comment
nikitafloy Posted February 9, 2017 Share Posted February 9, 2017 (edited) onPlayerWeaponSwitch takeWeapon Edited February 9, 2017 by nikitafloy Link to comment
Function Posted February 9, 2017 Author Share Posted February 9, 2017 Can you explain it better please, I think I need to start with a new function right? Link to comment
nikitafloy Posted February 9, 2017 Share Posted February 9, 2017 (edited) 1 hour ago, Function said: Can you explain it better please, I think I need to start with a new function right? No, and take all weapons - takeAllWeapons(player) And check getElementData, on dm player or not, after that u use takeAllWeapon and people haven't weapons Edited February 9, 2017 by nikitafloy 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