Search the Community
Showing results for tags 'delay'.
Found 4 results
I have this: function Salir() if isElement(tableVehicles[source]) then destroyElement(tableVehicles[source]) end end addEventHandler("onPlayerVehicleExit",getRootElement(),Salir) This function destroys the vehicle when the player leaves, I want this to happen after a second and not immediately, i need to use "Set timer", but I do not know how to use it, I tried different ways but none of them
I have been having a lot of trouble with my mouse lately that's causing it to have a very large delay on MTA which makes it LITERALLY impossible to play on a server normally. Although the issue originally arose some time last year, it is only now it has came to my proper attention again as I wish to be able to play on a server. I have tried many things to fix this and I can safely dismiss it being the mouse simply because it does this on MTA only; and on my other two PC's as well. Does anyone have any idea what the issue is and how I can solve it? I have tried quite a few things now but there are hardly any topics related to this kind of issue.
Hello friends, I have a problem. I have a little delay when I watch the player. Code: function randomSpectatePlayer() local playerGroup = getElementData(localPlayer, "player:group") or false if playerGroup then local inGame = getElementData(localPlayer, "player:game") or false for k,v in ipairs(playerGroup) do if isElement(v) and getElementData(v, "player:game") and getElementData(localPlayer, "player:onSpawn") then if v ~= localPlayer then setElementFrozen ( localPlayer, true ) oldDim = getElementInterior(localPlayer) oldInt = getElementDimension(localPlayer) setElementInterior(localPlayer, getElementInterior(v)) setElementDimension(localPlayer, getElementDimension(v)) setCameraInterior(localPlayer, getCameraInterior(v)) spectating = v setCameraTarget ( v ) outputChatBox("[SPECTATE] #ffffffYou spectating now "..getPlayerName(v), 255,100,100,true) outputChatBox("[SPECTATE] #ffffffIf you want back to lobby use #ff0000/back #ffffffcommand.", 255,100,100,true) addCommandHandler("back", onStopSpectating) end end end end end
I'd like to sugest a delay() function because, in my opinion, it will be helpful and it will save you from using plenty of setTimers or any function like that. How can this function can be helpful?: Delay between two actions( switching two images ) Some interesting effects etc... (I'm sorry if this kind of function exists, i didn't notice it)