SA-MP Forums Archive
First Player - 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: First Player (/showthread.php?tid=423106)



First Player - Blackazur - 16.03.2013

Hello, how to make that this only work with the first Player who made a Kill? Because now, it works for every Player who made his first Kill, but i want that it work only for ONE Player who made the FIRST Kill.
Код:
case 1: format(kstring,sizeof(kstring),""chat""COL_RED" %s has achieved a FIRST BLOOD! "COL_LIGHTBLUE"(+10 XP) (1 Cookie)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 10,pInfo[killerid][pCookies] += 1;



Re: First Player - zxc1 - 16.03.2013

Create some variable..
Example:
pawn Код:
new firstkillmade;
And check using comparison ( == 0, == 1). I think you understood me.


Re: First Player - kamzaf - 16.03.2013

IUntested:
pawn Код:
enum Server
{
     FirstKill
};
new ServerInfo[Server];
public OnGameModeInit()
{
      ServerInfo[FirstKill] = 1;
      return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
        if(ServerInfo[FirstKill] == 1)
        {
            format(kstring,sizeof(kstring),""chat""COL_RED" %s has achieved a FIRST BLOOD! "COL_LIGHTBLUE"(+10 XP) (1 Cookie)",PlayerName(killerid))
            SendClientMessageToAll(-1,kstring);
            pInfo[killerid][pXP] += 10;
            pInfo[killerid][pCookies] += 1;
            ServerInfo[FirstKill] == 0;
        }
        return 1;
}