Loop while player is alive
How would I create a loop that executes a command every x amount of seconds while the player is alive.
|
Re: Loop while player is alive
How about CreateTimer(1.0, DatTimer, client, TIMER_REPEAT) and keep a Float:g_fTimerCount[MAXPLAYERS + 1] increasing by 1.0 each iteration of the timer. If they're alive, increase g_fTimerCount. If they're dead, set g_fTimerCount back to 0.0 and wait for them to spawn. If g_fTimerCount >= CommandDelay, g_fTimerCount = 0, IssueCommand. Pesudodrunkocodo.
|
Re: Loop while player is alive
Quote:
For example, if I already have: Code:
public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast) { |
Re: Loop while player is alive
PHP Code:
|
Re: Loop while player is alive
Quote:
|
Re: Loop while player is alive
Because I don't tend to write many timers using TIMER_REPEAT, and while I considered return Plugin_Stop, I wasn't entirely sure it worked in that instance.
|
Re: Loop while player is alive
I suggest use global Handle, create timer using Handle array index by client index... (what I writing here ?)
Anyway. *edit Then let use only client indexs
Spoiler
Like wiki site |
All times are GMT -4. The time now is 19:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.