Online Time Bonus?
#1

Hey guys, I just made a timer of this.

pawn Код:
SetTimer("1hourbonus", 3600000, 1);
But, I don't know how to do it. So, basically how can I do it?
Reply
#2

A one-hour bonus for a player, so one player one timer.

pawn Код:
#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;
}
A basic one should look like that.
Reply
#3

lolwat, that ban reason is obvious, anyway, I will try it out!
Reply
#4

You wanted the one without variable thingy :
pawn Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)