Spree help
#1

Hi

I was thinking about is possible make when i make example 10 spree it will show i nstats High spree ever: 10 ?

How to make this and is possible ? +rep if helped
Reply
#2

Use a variable and add 1 to it every time a player kills another player. Display that variable in /stats. More information can be found in this link.

PHP код:
new PlayerKillCount[MAX_PLAYERS];
new 
HighestKillCount[MAX_PLAYERS];
 
public 
OnPlayerDeath(playeridkilleridreason)
{
    if(
killerid != INVALID_PLAYER_ID)
    {
        
PlayerKillCount[killerid] ++;
    }
    if(
PlayerKillCount[killerid] > HighestKillCount[killerid])
    {
        
HighestKillCount[killerid] = PlayerKillCount[killerid];
    }
    return 
1;

PHP код:
new string[256];
if(
PlayerKillCount[playerid] >= 10)
{
    
format(stringsizeof(string), "Current kill spree: %d"PlayerKillCount[playerid]);
    
format(stringsizeof(string), "Highest kill spree: %d"HighestKillCount[playerid]);

This is just a rough example of the system you describe but it can easily be modified. You would also need to utilise a saving system for individual players to save their highest kill count.
Reply
#3

Ok thanks for helping i will try +rep for you
Reply
#4

Appreciated, feel free to PM me if you need any more help
Reply
#5

Quote:
Originally Posted by Gazzy
Посмотреть сообщение
-
Don't forget to reset the current killing spree of playerid in OnPlayerDeath.
Reply
#6

The second if statement will cause run time error 4 if a player dies on their own. It should be inside the (killerid != INVALID_PLAYER_ID) check to prevent this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)