Jump to content

no deathmatch


xJ4ckk

Recommended Posts

------
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
  • 2 weeks later...

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