26.10.2013, 05:45
pawn Код:
new payDAY[ MAX_PLAYERS ] = {-1, ...};
forward public Pay_Player( playerid );
#define PAY_EVERY_MINS 5 // pay every 5 minutes
public OnPlayerConnect( playerid )
{
payDAY[ playerid ] = SetTimerEx( "Pay_Player", PAY_EVERY_MINS * 60, 1, "d", playerid );
return 1;
}
public OnPlayerDisconnect( playerid, reason )
{
KillTimer( payDAY[ playerid ] );
return 1;
}
public Pay_Player( playerid )
{
switch( GetPlayerLevel( playerid ) )
{
case 1: GivePlayerMoney( playerid, 500 ), SendClientMessage( playerid, -1, "Received paycheck." );
case 2: ... ;
}
return 1;
}