Kill spree - trouble
#1

Well, i've scripted this:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{   Killsprees[killerid] ++;
    Killsprees[playerid] = 0;
   
    if(Killsprees[killerid] == 3)
    {
       new pname2[MAX_PLAYER_NAME],string[22+ MAX_PLAYER_NAME];
       GetPlayerName(playerid,pname2,sizeof(pname2));
       format(string,sizeof(string),"%s Is on a killing spree of 3",pname2);
       SendClientMessageToAll(Streakcolor,string);
    }
    if(Killsprees[killerid] == 5)
    {
       new pname2[MAX_PLAYER_NAME],string[22+ MAX_PLAYER_NAME];
       GetPlayerName(playerid,pname2,sizeof(pname2));
       format(string,sizeof(string),"%s Is on a killing spree of 5",pname2);
       SendClientMessageToAll(Streakcolor,string);
   
    }
    if(Killsprees[killerid] == 10)
    {
       new pname2[MAX_PLAYER_NAME],string[22+ MAX_PLAYER_NAME];
       GetPlayerName(playerid,pname2,sizeof(pname2));
       format(string,sizeof(string),"%s Is on a killing spree of 10!",pname2);
       SendClientMessageToAll(Streakcolor,string);
   
    }
    return 1;
}
The trouble is when it reaches 3 - 5 or even 10, it shows that the killed player has a killing spree, does anyone know why this is actually happening?

Thanks
Reply
#2

Код:
public OnPlayerDeath(playerid, killerid, reason)
{   Killsprees[killerid] ++;
    Killsprees[playerid] = 0;
   
    if(Killsprees[killerid] == 3)
    {
       new pname2[MAX_PLAYER_NAME],string[22+ MAX_PLAYER_NAME];
       GetPlayerName(killerid,pname2,sizeof(pname2));
       format(string,sizeof(string),"%s Is on a killing spree of 3",pname2);
       SendClientMessageToAll(Streakcolor,string);
    }
    if(Killsprees[killerid] == 5)
    {
       new pname2[MAX_PLAYER_NAME],string[22+ MAX_PLAYER_NAME];
       GetPlayerName(killerid,pname2,sizeof(pname2));
       format(string,sizeof(string),"%s Is on a killing spree of 5",pname2);
       SendClientMessageToAll(Streakcolor,string);
   
    }
    if(Killsprees[killerid] == 10)
    {
       new pname2[MAX_PLAYER_NAME],string[22+ MAX_PLAYER_NAME];
       GetPlayerName(killerid,pname2,sizeof(pname2));
       format(string,sizeof(string),"%s Is on a killing spree of 10!",pname2);
       SendClientMessageToAll(Streakcolor,string);
   
    }
    return 1;
}
You want to get the name of the Killer ID...You had it getting the Player ID..
Reply
#3

Quote:
Originally Posted by <Weponz>
Посмотреть сообщение
Код:
public OnPlayerDeath(playerid, killerid, reason)
{   Killsprees[killerid] ++;
    Killsprees[playerid] = 0;
   
    if(Killsprees[killerid] == 3)
    {
       new pname2[MAX_PLAYER_NAME],string[22+ MAX_PLAYER_NAME];
       GetPlayerName(killerid,pname2,sizeof(pname2));
       format(string,sizeof(string),"%s Is on a killing spree of 3",pname2);
       SendClientMessageToAll(Streakcolor,string);
    }
    if(Killsprees[killerid] == 5)
    {
       new pname2[MAX_PLAYER_NAME],string[22+ MAX_PLAYER_NAME];
       GetPlayerName(killerid,pname2,sizeof(pname2));
       format(string,sizeof(string),"%s Is on a killing spree of 5",pname2);
       SendClientMessageToAll(Streakcolor,string);
   
    }
    if(Killsprees[killerid] == 10)
    {
       new pname2[MAX_PLAYER_NAME],string[22+ MAX_PLAYER_NAME];
       GetPlayerName(killerid,pname2,sizeof(pname2));
       format(string,sizeof(string),"%s Is on a killing spree of 10!",pname2);
       SendClientMessageToAll(Streakcolor,string);
   
    }
    return 1;
}
You want to get the name of the Killer ID...You had it getting the Player ID..
Ohhhh yea, thanks. I guess i shouldn't of copied the join code rofl
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)