18.12.2014, 02:30
You are using a 'playerid' parameter when you have used a 'SetTimer' function. Parameters are only acceptable for use with the 'SetTimerEx' function. In this case, you are doing a loop for all players, so a 'playerid' parameter is unnecessary.
pawn Код:
forward ReduceWantedLevel();
public ReduceWantedLevel()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
new original = GetPlayerWantedLevel(i);
switch(original)
{
case 0: continue;
case 1 .. 10: SetPlayerWantedLevel(i, (original - 1));
case 11 .. 20: SetPlayerWantedLevel(i, (original - 5));
case 21 .. 28: SetPlayerWantedLevel(i, (original - 8));
case 29, 30: SetPlayerWantedLevel(i, (original - 2));
default: SetPlayerWantedLevel(i, (original - 5));
}
new var = GetPlayerWantedLevel(i), fstr[55];
format(fstr, sizeof(fstr), "[WANTED]: You have lost %d wanted levels. [Level %d]", (original - var), var);
SendClientMessage(i, yellow, (var) ? (fstr) : ("[WANTED]: You have now lost your wanted levels [Innocent]"));
}
return 1;
}