No cash or score given :(
#1

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

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

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

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

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
Reply
#6

Still don't work :/
Reply
#7

the score didnt update?
Reply
#8

OR cash,
Reply
#9

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

Still not working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)