Jump to content

Murder Command


Atton

Recommended Posts

I have been trying to use get and set element data for this murder command.

Can anyone help.

  
setElementData ( player, "Mode.murder", true ) 
  
function rapef (player,command,tpName,source) 
local tp = getPlayerFromName(tpName)  
    if getElementData( player, "Mode.murder" ) then 
      setElementData ( player, "Mode.murder", false ) 
        killPed(tp) 
        setTimer(YCRN,40000,1) 
        outputChatBox("You murdered: ".. tostring(tp)) 
    else 
      outputChatBox("Hold up there mate",player) 
        end 
    end      
addCommandHandler("murder",murderf) 
  
  
  
--if tp then 
function YCRN () 
setElementData ( player, "Mode.murder", true ) 
end 
  

Link to comment
addEventHandler("onResourceStart", resourceRoot, 
function() 
    for i, player in ipairs(getElementsByType("player")) do 
        setElementData(player, "Mode.murder", false, false) 
    end 
end) 
  
function murderf(player, command, tpName) 
    if tpName then 
        local tp = getPlayerFromName(tpName) 
        if tp and not getElementData(player, "Mode.murder") then 
            setElementData(player, "Mode.murder", true, false) 
            killPed(tp) 
            outputChatBox("You murdered: "..tpName) 
            setTimer(function(player)  
                setElementData(player, "Mode.murder", false, false)  
            end, 40000, 1, player) 
        else 
            outputChatBox("Hold up there mate", player) 
        end 
    end 
end     
addCommandHandler("murder", murderf) 

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