[PROBLEM]OnPlayerDeath - 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: [PROBLEM]OnPlayerDeath (
/showthread.php?tid=350131)
[PROBLEM]OnPlayerDeath -
Rg-Gaming.Info - 11.06.2012
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:
pawn Код:
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. I changed all pKills to pScore
Re: [PROBLEM]OnPlayerDeath -
CoaPsyFactor - 11.06.2012
pScore[killerid] = pScore[killerid] + 1; try this
Re: [PROBLEM]OnPlayerDeath -
Rg-Gaming.Info - 11.06.2012
Quote:
Originally Posted by CoaPsyFactor
pScore[killerid] = pScore[killerid] + 1; try this 
|
Didn't worked i got the same errors.
Re: [PROBLEM]OnPlayerDeath -
Niko_boy - 11.06.2012
do u have this at top < inscript > ?
-> new pScore[MAX_PLAYERS];
if no add it
Re: [PROBLEM]OnPlayerDeath -
Rg-Gaming.Info - 11.06.2012
Quote:
Originally Posted by Niko_boy
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
Re: [PROBLEM]OnPlayerDeath -
CoaPsyFactor - 11.06.2012
not in enum, but new pScore[MAX_PLAYERS]
Re: [PROBLEM]OnPlayerDeath -
nickdodd25 - 11.06.2012
Idk how your saving system/player stats are set up but if you have a enum then you need something like
pawn Код:
PlayerInfo[killerid][pScore]++;
But player info would be changed to what you have.
Show your enum and then the array it goes to.