SA-MP Forums Archive
No cash or score given :( - 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: No cash or score given :( (/showthread.php?tid=392526)



No cash or score given :( - Elysian` - 14.11.2012

When you get a kill it doesn't give you cash or score.. Help?

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
            new string[128], string1[128];
          PlayerInfo[playerid][pScore] +=(killerid, GetPlayerScore(killerid)+1);
          PlayerInfo[killerid][pCash] +=(GetPlayerMoney(killerid)+1000);
          PlayerInfo[killerid][pKills] ++;
          PlayerInfo[playerid][pDeaths] ++;
          format(string, sizeof(string), "You killed %s and recieved $1,000!", Name(playerid));
          SendClientMessage(killerid, COLOR_CYAN, string);
          format(string1, sizeof(string1), "You've been killed by %s!", Name(killerid));
          SendClientMessage(playerid, COLOR_CYAN, string1); // See? Nothing wrong and you don't get it?

     }
     return 1;
}



Re: No cash or score given :( - Glad2BeHere - 14.11.2012

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
          new string[128], string1[128];
          PlayerInfo[playerid][pScore] ++;
          SetPlayerScore(killerid, PlayerInfo[killerid][pScore]
          GivePlayerMoney(killerid, 1000)//delete 1
          PlayerInfo[killerid][pCash] += 1000; //delete 1
          PlayerInfo[killerid][pKills] ++;
          PlayerInfo[playerid][pDeaths] ++;
          format(string, sizeof(string), "You killed %s and recieved $1,000!", Name(playerid));
          SendClientMessage(killerid, COLOR_CYAN, string);
          format(string1, sizeof(string1), "You've been killed by %s!", Name(killerid));
          SendClientMessage(playerid, COLOR_CYAN, string1); // See? Nothing wrong and you don't get it?

     }
     return 1;
}



Re: No cash or score given :( - Xbowman - 14.11.2012

pawn code:
if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
GivePlayerMoney(killerid,5000);


Re: No cash or score given :( - Elysian` - 14.11.2012

pawn Код:
PlayerInfo[playerid][pScore] ++;
          SetPlayerScore(killerid, PlayerInfo[killerid][pScore]);
Dafuq is this? You just complicated things.
The way I used it was better -.-'


Re: No cash or score given :( - Glad2BeHere - 14.11.2012

i dont know ur code working with what i know
pawn Код:
//edited that part :/
PlayerInfo[killerid][pScore] ++;
SetPlayerScore(killerid, PlayerInfo[killerid][pScore]);
First ++ means set the value plus 1 so its sets the killerid pScore value to 1 plus
then afterwards sets the killerid score to whatever it is in the pScore therefore updating his score


Re: No cash or score given :( - Elysian` - 14.11.2012

Still don't work :/


Re: No cash or score given :( - Glad2BeHere - 14.11.2012

the score didnt update?


Re: No cash or score given :( - Elysian` - 14.11.2012

OR cash,


Re: No cash or score given :( - sleepysnowflake - 14.11.2012

dunno lol, try adding return 1;
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
            new string[128], string1[128];
          PlayerInfo[playerid][pScore] +=(killerid, GetPlayerScore(killerid)+1);
          PlayerInfo[killerid][pCash] +=(GetPlayerMoney(killerid)+1000);
          PlayerInfo[killerid][pKills] ++;
          PlayerInfo[playerid][pDeaths] ++;
          format(string, sizeof(string), "You killed %s and recieved $1,000!", Name(playerid));
          SendClientMessage(killerid, COLOR_CYAN, string);
          format(string1, sizeof(string1), "You've been killed by %s!", Name(killerid));
          SendClientMessage(playerid, COLOR_CYAN, string1); // See? Nothing wrong and you don't get it?
          return 1;
     }
     return 1;
}



Re: No cash or score given :( - Elysian` - 14.11.2012

Still not working