20.01.2014, 00:07
You would need a timer that is called every second and updates the marker. For example, in /backup you could put:
And then the timer would be:
And wherever you cancel the backup or however it gets ended you can put:
Код:
//This goes at the top of the script somewhere new BackupTimer[MAX_PLAYERS]; BackupTimer[playerid] = SetTimerEx("BackupTimer", 1000, true, "i", playerid);
Код:
forward BackupTimer(playerid); public BackupTimer(playerid) { new Float:pPos[3]; GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]); foreach(Player, i) { if(gTeam[i] == 2 || IsACop(i)) { SetPlayerCheckpoint(i, pPos[0], pPos[1], pPos[2], 5.0); } } }
Код:
KillTimer(BackupTimer[playerid]);