First Player
#1

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;
Reply
#2

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)