Quote:
|
Originally Posted by WrathOfGenesis
pawn Код:
public LWantedLevel ( ) { for ( new playerid = 0; playerid < MAX_PLAYERS; playerid ++ ) { if ( IsPlayerConnected ( playerid ) ) { if ( GetPlayerWantedLevel ( playerid ) > 1 && GetPlayerWantedLevel ( playerid ) < 6 ) { SetPlayerWantedLevel ( playerid , GetPlayerWantedLevel ( playerid ) - 1 ); } } } }
If you put this as your timer and it will work for all people with wanted levels. Saves making 200 timers if you have 200 players.
|
I would make like this:
pawn Код:
public LWantedLevel ()
{
for (new playerid = 0; playerid<MAX_PLAYERS; playerid++)
{
if (IsPlayerConnected(playerid))
{
if (GetPlayerWantedLevel(playerid)=>1 && GetPlayerWantedLevel(playerid)=<6)
{
SetPlayerWantedLevel (playerid,GetPlayerWantedLevel(playerid)-1);
}
}
}
}
or it would ignore players with 1 and 6 wanted lvl :P