21.04.2013, 11:58
Hey guys, I just made a timer of this.
But, I don't know how to do it. So, basically how can I do it?
pawn Код:
SetTimer("1hourbonus", 3600000, 1);
SetTimer("1hourbonus", 3600000, 1);
#include < a_samp >
new
bonusTimer[ MAX_PLAYERS ];
public OnPlayerConnect( playerid )
{
bonusTimer[ playerid ] = SetTimerEx( "BonusOneHour", 3600 * 1000 /* 3600 x 1 seconds */, true, "i", playerid );
return true;
}
public OnPlayerDisconnect( playerid, reason )
{
KillTimer( bonusTimer[ playerid ] );
return true;
}
forward BonusOneHour( playerid );
public BonusOneHour( playerid )
{
SendClientMessage( playerid, -1, "Bonus! You got a ban for playing 1 hours." );
BanEx( playerid, "Too much playing on the server." );
return true;
}
public OnGameModeInit( )
{
SetTimer( "OneHourBonus", 3600 * 1000, true );
return true;
}
forward OneHourBonus( );
public OneHourBonus( )
{
for ( new i, slots = GetMaxPlayers( ); i < slots; i ++ )
{
GivePlayerMoney( i, 5000 );
SendClientMessage( i, -1, "ONE HOUR AWARD!" );
}
return 1;
}