Adding 3 minutes time to a player if he kills someone
#1

Is that possible to add 3 minutes login time to a player if he kills someone? If possible can you reply for the script.

EDIT: I am using timer to get score every 30 minutes. It means 30 minutes of playing = 1 Score. or Basically player can only gain score using this timer.

Код:
forward scoretimer();
public scoretimer()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        seconds[i] ++;
        if(seconds[i] == 1800)
        {
            SetPlayerScore(i, GetPlayerScore(i) + 1);
            seconds[i] = 0;
        }
    }
    return 1;
}
EDIT: Example player Log in time is 0 Hours| 5 minutes | 0 seconds.
If player kill someone. He will gain 3 minutes, and his login time will be
0 Hours | 8 minutes | 0 seconds.

Something like this.
Reply
#2

What? Honestly, use common sense and tell us what you want before you make us your slaves.

3 minutes of what?
Reply
#3

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) {
        seconds[killerid] += 180;
    }
    // rest of your code
    return 1;
}
also in the timer change it to
Код:
if(seconds[i] >= 1800)
because if a player is 10 seconds away from gaining score and kills someone, no score for them.
Reply
#4

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) {
        seconds[killerid] += 180;
    }
    // rest of your code
    return 1;
}
also in the timer change it to
Код:
if(seconds[i] >= 1800)
because if a player is 10 seconds away from gaining score and kills someone, no score for them.
Wow! Thanks man +rep. Really great for the server!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)