06.11.2010, 14:21
On Top :
OnPlayerSpawn Callback :
OnPlayerDisconnect Callback :
Then SetTimer("TimerName", 1000, true);
Put that on the Callback OnPlayerSpawn
then :
Somewhere when someone loses just do :
PlayerVar[playerid] = 0;
PlayerTotalVar--;
pawn Код:
New PlayerTotalVar;
new PlayerVar[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
PlayerTotalVar++;
PlayerVar[playerid] = 1;
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
PlayerTotalVar--;
return 1;
}
Put that on the Callback OnPlayerSpawn
then :
pawn Код:
forward TimeName(playerid);
public TimeName(playerid)
{
if(PlayerTotalVar == 1 && PlayerVar[playerid] == 1)
{
GivePlayerMoney....
}
return 1;
}
PlayerVar[playerid] = 0;
PlayerTotalVar--;