06.04.2013, 04:13
The function of this code is simple, every 5 minutes it DECREASES one of a wanted level, and if you have not tried level, ie, if 0, it simply calls the KillTimer to stop counting, the problem is that if the player LOG iN SERVER wITH 0 of demand and eventually earn him a star the code does not take the stars, it just takes if I relog, it's because I'm putting it into the public SetTimer OnPlayerConnect (playerid).
HOW TO SOLVE THIS? WOULD THE TAKING OF OnPlayerConnect SetTimer (playerid)? IF SO, WHERE SHOULD I WEAR THE SetTimer?
HOW TO SOLVE THIS? WOULD THE TAKING OF OnPlayerConnect SetTimer (playerid)? IF SO, WHERE SHOULD I WEAR THE SetTimer?
pawn Код:
forward WantedLevelDown(playerid);
public WantedLevelDown(playerid)
{
if(WantedPoints[playerid] == 0) return KillTimer(GetPVarInt(playerid, "Timer"));
{
if((WantedPoints[playerid] - 1) >= 0)
{
static wanSTR[100];
-- WantedPoints[playerid];
format(wanSTR, sizeof wanSTR, ">> seu level de procurado abaixou para %02i", WantedPoints[playerid]);
SendClientMessage(playerid, -1, wanSTR);
SetPlayerWantedLevel(playerid, WantedPoints[playerid]);
if(WantedPoints[playerid] == 0) return KillTimer(GetPVarInt(playerid, "Timer"));
}
return 0x01;
}
}