CapY Posted November 26, 2011 Share Posted November 26, 2011 It would be good to add things like : onZoneEnter Required Arguments: -Zonename onZoneLeave Required Arguments: -Zonename isPlayerLogged Required Arguments: -thePlayer -bool Example: if isPlayerLogged(source,true) then --do something end onResourceRestart I'm not so good at explaining. Waiting for your opinion. Link to comment
12p Posted November 26, 2011 Share Posted November 26, 2011 onZoneEnter may be applied to GTA SA built-in zones like Idlewood? Then, yeah, it would be good. isPlayerLoggedIn can be done via scripting, here you have: function isPlayerLoggedIn ( player ) if getElementType ( player ) ~= "player" then return end return not isGuestAccount ( getPlayerAccount ( player ) ) end Link to comment
qaisjp Posted November 27, 2011 Share Posted November 27, 2011 onResourceRestart I'm not so good at explaining. Waiting for your opinion. That isn't possible, all it is done is by stopping and starting. I dont think there is /restart Link to comment
CapY Posted November 27, 2011 Author Share Posted November 27, 2011 onResourceRestart I'm not so good at explaining. Waiting for your opinion. I dont think there is /restart There is no /restart function. Link to comment
arezu Posted November 29, 2011 Share Posted November 29, 2011 all the events, and function except onResourceRestart, which can be made by making a custom command to restart resources, or by checking the time difference between onResourceStop and onResourceStart. local oldZone = "" local oldCity = "" addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() addEventHandler("onClientRender", getRootElement(), checkZone) end) function checkZone() local posX, posY, posZ = getElementPosition(getLocalPlayer()) local zone = getZoneName(posX, posY, posZ, false) local city = getZoneName(posX, posY, posZ, true) if(zone ~= oldZone)then if(oldZone ~= "" and oldCity ~= "")then triggerEvent("onZoneLeave", getLocalPlayer(), oldZone, oldCity) end oldZone = zone oldCity = city triggerEvent("onZoneEnter", getLocalPlayer(), zone, city) end end function isPlayerLogged(player) local account = getPlayerAccount(player) if(account == false)then return false end return (not isGuestAccount(account)) end Link to comment
Recommended Posts