[PROBLEM]OnPlayerDeath
#1

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]++;

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

pScore[killerid] = pScore[killerid] + 1; try this
Reply
#3

Quote:
Originally Posted by CoaPsyFactor
Посмотреть сообщение
pScore[killerid] = pScore[killerid] + 1; try this
Didn't worked i got the same errors.
Reply
#4

do u have this at top < inscript > ?
-> new pScore[MAX_PLAYERS];
if no add it
Reply
#5

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

not in enum, but new pScore[MAX_PLAYERS]
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)