Jump to content

Zlimit death


DuCt_TaPe

Recommended Posts

add this as client side script (more about resources, meta.xml etc on mta wiki)

  
setTimer(function() 
  local xx,yy,zz = getElementPosition(getLocalPlayer()) 
  if (not isPlayerWasted(getLocalPlayer()) and zz < 50) then 
    triggerServerEvent("onPlayerRequestSuicide", getLocalPlayer()) 
  end 
end, 250, 0) 
  

and this as server side:

  
addEvent("onPlayerRequestSuicide", true) 
addEvent("onPlayerRequestSuicide", getRootElement(), function() 
  killPed(source) 
end) 
  

Link to comment

hmm, never used settings, i think its time to get some knowledge, i'll edit this post within 15 minutes

edit:

got it, was harder that i think it will, but got it:

client:

  
zlimit = -10000 
  
setTimer(function() 
  local xx,yy,zz = getElementPosition(getLocalPlayer()) 
  if (not isPlayerWasted(getLocalPlayer()) and zz < zlimit) then 
    triggerServerEvent("onPlayerRequestSuicide", getLocalPlayer()) 
  end 
end, 250, 0) 
  
addEvent("onClientCall_race",true) 
addEventHandler("onClientCall_race", getRootElement(), 
function(name, veh, check, obj, pick, opt) 
    if name == 'initRace' then 
        if (opt['Zlimit']) then 
            zlimit = tonumber(opt['Zlimit']) 
        else 
            zlimit = -10000 
        end 
    end 
end) 
  

server

  
addEvent("onPlayerRequestSuicide", true) 
addEvent("onPlayerRequestSuicide", getRootElement(), function() 
  killPed(source) 
end) 
  

i will make it new resource, and upload to community tommorow, i think some ppl will want to have this :)

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