[HELP] Compile errors!
#1

Errors:
pawn Код:
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(318) : error 029: invalid expression, assumed zero
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(318) : warning 215: expression has no effect
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(318) : error 001: expected token: ";", but found ")"
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(318) : error 029: invalid expression, assumed zero
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(318) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 * * Copyright (c) 1997-2006, ITB CompuPhase
Here are the lines 314 - 339:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pKills]++;
    PlayerInfo[playerid][pDeaths]++;
    if(pInsurance == 1(playerid))
    {
        SendClientMessage(playerid, COLOR_GREEN. "** You have been sent to All Saints Hospital **");
        SetPlayerPos(playerid, 1172.8149, -1325.5315, 15.4003);
        SetPlayerHealth(playerid, 100);
        GivePlayerMoney(playerid, -1000);
    }
    if(pInsurance == 2(playerid))
    {
        SendClientMessage(playerid, COLOR_GREEN. "** You have been sent to General Hospital **");
        SetPlayerPos(playerid, 2030.3564, -1408.9563, 16.9989);
        SetPlayerHealth(playerid, 100);
        GivePlayerMoney(playerid, -1000);
    }
      SendClientMessage(playerid, COLOR_GREEN. "** You have been sent to a hospital **");
      SendClientMessage(playerid, COLOR_GREEN. "** Next time buy insurance! **");
      SetPlayerPos(playerid, 2030.3564, -1408.9563, 16.9989);
      SetPlayerHealth(playerid, 100);
      GivePlayerMoney(playerid, -2500);
    return 1;
}
Reply
#2

pawn Код:
if(pInsurance == 1(playerid))

if(pInsurance == 2(playerid))
It's incorrect

Wouldn't be this?
pawn Код:
if(pInsurance[playerid] == 1)

if(pInsurance[playerid] == 2)
Reply
#3

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pKills]++;
    PlayerInfo[playerid][pDeaths]++;
    if(pInsurance[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_GREEN. "** You have been sent to All Saints Hospital **");
        SetPlayerPos(playerid, 1172.8149, -1325.5315, 15.4003);
        SetPlayerHealth(playerid, 100);
        GivePlayerMoney(playerid, -1000);
    }
    if(pInsurance[playerid] == 2)
    {
        SendClientMessage(playerid, COLOR_GREEN. "** You have been sent to General Hospital **");
        SetPlayerPos(playerid, 2030.3564, -1408.9563, 16.9989);
        SetPlayerHealth(playerid, 100);
        GivePlayerMoney(playerid, -1000);
    }
      SendClientMessage(playerid, COLOR_GREEN. "** You have been sent to a hospital **");
      SendClientMessage(playerid, COLOR_GREEN. "** Next time buy insurance! **");
      SetPlayerPos(playerid, 2030.3564, -1408.9563, 16.9989);
      SetPlayerHealth(playerid, 100);
      GivePlayerMoney(playerid, -2500);
    return 1;
}
Reply
#4

You should also check whether killerid == INVALID_PLAYER_ID before doing

PlayerInfo[killerid][pKills]++;

because if it's INVALID_PLAYER_ID the code after that won't be processed as it will crash, because you're trying to access an index out of bounds.
Reply
#5

(face palm) , Thanks guys
Reply
#6

pawn Код:
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(318) : error 028: invalid subscript (not an array or too many subscripts): "pInsurance"
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(318) : warning 215: expression has no effect
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(318) : error 001: expected token: ";", but found "]"
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(318) : error 029: invalid expression, assumed zero
C:\Users\Rob\Documents\PAWNO\gamemodes\NRP.pwn(318) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 * * Copyright (c) 1997-2006, ITB CompuPhase
Some lovely new errors! :P
Reply
#7

Show the lines
Reply
#8

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Show the lines
Its the exact same as the ones on the first post :P
Reply
#9

bump
Reply
#10

Change The defined pInsurance(playerid) to
Код:
new pInsurance[MAX_PLAYERS] =0;
At Top of u script,
Or send us u defined pInsurance(playerid)

PS:Thanks for the 1000 post
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)