SA-MP Forums Archive
Kill spree - trouble - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Kill spree - trouble (/showthread.php?tid=186740)



Kill spree - trouble - Jay. - 30.10.2010

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


Re: Kill spree - trouble - <Weponz> - 30.10.2010

Код:
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..


Re: Kill spree - trouble - Jay. - 30.10.2010

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