PDA

View Full Version : [PROBLEM]OnPlayerDeath


Rg-Gaming.Info
11/06/2012, 02:30 PM
Hello guys i have a little problem here every time i try to implement this function into OnPlayerDeath i get

invalid subscript (not an array or too many subscripts): "pScore"
expression has no effect
expected token: ";", but found "]"
invalid expression, assumed zero
too many error messages on one line


That is for the line:
pScore[killerid]++;



SendDeathMessage(killerid, playerid, reason);

if(killerid != INVALID_PLAYER_ID)
{
pScore[killerid]++;
SetPlayerScore(killerid, pScore[killerid]);

pCash[killerid] += 100;
GivePlayerMoney(killerid, 100);
}

pDeaths[playerid]++;
pCash[playerid] -= 100;
pScore[playerid]--;
SetPlayerScore(playerid, pScore[playerid]);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, pCash[playerid]);


Any idea how to fix it ? I took it from the wiki and i am trying to implement it in the BFTDM GM(my gm). And i am using register system from here (http://forum.sa-mp.com/showthread.php?t=273088). I changed all pKills to pScore

CoaPsyFactor
11/06/2012, 03:03 PM
pScore[killerid] = pScore[killerid] + 1; try this :D

Rg-Gaming.Info
11/06/2012, 03:14 PM
pScore[killerid] = pScore[killerid] + 1; try this :D

Didn't worked i got the same errors.

Niko_boy
11/06/2012, 03:22 PM
do u have this at top < inscript > ?
-> new pScore[MAX_PLAYERS];
if no add it

Rg-Gaming.Info
11/06/2012, 03:28 PM
do u have this at top < inscript > ?
-> new pScore[MAX_PLAYERS];
if no add it

I said i am using the register system.... and i have pScore in enum

CoaPsyFactor
11/06/2012, 03:35 PM
not in enum, but new pScore[MAX_PLAYERS]

nickdodd25
11/06/2012, 04:26 PM
Idk how your saving system/player stats are set up but if you have a enum then you need something like

PlayerInfo[killerid][pScore]++;

But player info would be changed to what you have.
Show your enum and then the array it goes to.