Adding 3 minutes time to a player if he kills someone - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Adding 3 minutes time to a player if he kills someone (
/showthread.php?tid=361347)
Adding 3 minutes Login time to a player if he kills someone -
kbalor - 20.07.2012
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.
Re: Adding 3 minutes time to a player if he kills someone -
Kindred - 20.07.2012
What? Honestly, use common sense and tell us what you want before you make us your slaves.
3 minutes of what?
Re: Adding 3 minutes time to a player if he kills someone -
ReneG - 20.07.2012
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.
Re: Adding 3 minutes time to a player if he kills someone -
kbalor - 20.07.2012
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!