OnPlayerDeath help
#1

Hello,
I want to make like if I kill some one that I will get 1score and I will get money
This is what I made(I copied it from wiki)
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason); // Shows the kill in the killfeed/deathlog/death window

    if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
    {
        Player[killerid][pScore]++;
        SetPlayerScore(killerid, pScore[killerid]); //Error line 2058

        pMoney[killerid] += 100;
        GivePlayerCash(killerid, 100);
    }

    // Outside the check, handle stuff for playerid
    // if killerid was INVALID_PLAYER_ID the player killed themselves (i.e. falling)

    pDeaths[playerid]++;
    pMoney[playerid] -= 10;
    pScore[playerid]++;
    SetPlayerScore(playerid, pScore[playerid]);
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, pMoney[playerid]);
    return 1;
}
and this are the errors
Код:
(2058) : error 028: invalid subscript (not an array or too many subscripts): "pScore"
(2058) : warning 215: expression has no effect
(2058) : error 001: expected token: ";", but found "]"
(2058) : error 029: invalid expression, assumed zero
(2058) : fatal error 107: too many error messages on one line
Reply


Messages In This Thread
OnPlayerDeath help - by McFellow - 10.02.2013, 13:23
Re: OnPlayerDeath help - by Patrick - 10.02.2013, 13:25
Re: OnPlayerDeath help - by McFellow - 10.02.2013, 13:34
Re: OnPlayerDeath help - by MP2 - 10.02.2013, 13:36
Re: OnPlayerDeath help - by McFellow - 10.02.2013, 13:42

Forum Jump:


Users browsing this thread: 1 Guest(s)