DuCt_TaPe Posted September 25, 2010 Share Posted September 25, 2010 Trying to figure out how to implement a Zlimit death to some races. meaning map was posz=60 and u fell off the map you would die at posz= 50 anyone have a solution? Link to comment
dzek (varez) Posted September 25, 2010 Share Posted September 25, 2010 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
DuCt_TaPe Posted September 25, 2010 Author Share Posted September 25, 2010 yes basic scripts but each map has a different height needing different zlimits that is my challenge " " into each race map meta Link to comment
dzek (varez) Posted September 25, 2010 Share Posted September 25, 2010 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
DuCt_TaPe Posted September 25, 2010 Author Share Posted September 25, 2010 awesome i will try this out soon nice work 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