SA-MP Forums Archive
why i dont get cookies on spree? - 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: why i dont get cookies on spree? (/showthread.php?tid=646659)



why i dont get cookies on spree? - KyNe - 21.12.2017

Код:
    SendDeathMessage(playerid, killerid, reason);
    KillingSpree[playerid] = 0;
    KillingSpree[killerid]++;
    if(KillingSpree[killerid] == 50)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 50) (Reward : $60000 + %d Cookies)",KillerName, 100);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[playerid][Cookies] += 100;
     }

    if(KillingSpree[killerid] == 35)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 35) (Reward : $25000 + %d Cookies)",KillerName, 50);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[playerid][Cookies] += 50;
     }

    if(KillingSpree[killerid] == 20)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 20) (Reward : $25000 + %d Cookies)",KillerName, 35);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[playerid][Cookies] += 35;
     }

    if(KillingSpree[killerid] == 15)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 15) (Reward : $15000 + %d cookies)",KillerName, 25);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[playerid][Cookies] += 25;
     }

    if(KillingSpree[killerid] == 10)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 10) (Reward : $10000 + %d cookies)",KillerName, 15);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[playerid][Cookies] += 15;
     }

    if(KillingSpree[killerid] == 5)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 5) (Reward : $5000 + %d cookies)",KillerName, 10);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[playerid][Cookies] += 10;
     }

    if(KillingSpree[killerid] == 3)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 3) (Reward : $1500 + %d cookies)",KillerName, 5);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[playerid][Cookies] += 5;
     }



Re: why i dont get cookies on spree? - RogueDrifter - 21.12.2017

PlayerInfo[playerid][Cookies] += 5;
You're giving cookies to the player dying.
Change:

PHP код:
PlayerInfo[playerid][Cookies
To:
PHP код:
PlayerInfo[killerid][Cookies



Re: why i dont get cookies on spree? - KyNe - 21.12.2017

Код:
    SendDeathMessage(playerid, killerid, reason);
    KillingSpree[playerid] = 0;
    KillingSpree[killerid]++;
    if(KillingSpree[killerid] == 50)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 50) (Reward : $60000 + %d Cookies)",KillerName, 100);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[killerid][Cookies] += 100;
     }

    if(KillingSpree[killerid] == 35)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 35) (Reward : $25000 + %d Cookies)",KillerName, 50);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[killerid][Cookies] += 50;
     }

    if(KillingSpree[killerid] == 20)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 20) (Reward : $25000 + %d Cookies)",KillerName, 35);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[killerid][Cookies] += 35;
     }

    if(KillingSpree[killerid] == 15)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 15) (Reward : $15000 + %d cookies)",KillerName, 25);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[killerid][Cookies] += 25;
     }

    if(KillingSpree[killerid] == 10)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 10) (Reward : $10000 + %d cookies)",KillerName, 15);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[killerid][Cookies] += 15;
     }

    if(KillingSpree[killerid] == 5)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 5) (Reward : $5000 + %d cookies)",KillerName, 10);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[killerid][Cookies] += 10;
     }

    if(KillingSpree[killerid] == 3)
     {
      new KillerName[MAX_PLAYER_NAME]; GetPlayerName(killerid,KillerName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"%s is on a killing spree! (Kills : 3) (Reward : $1500 + %d cookies)",KillerName, 5);
      SendClientMessageToAll(COLOR_CYAN, string);
      PlayerInfo[killerid][Cookies] += 5;
     }
worked now,thanks