I'm getting errors in both cases.
#1

Hello
I've tried creating a script in 2 diffrent ways,in both ways I'm getting errors.
Way #1:
pawn Код:
if(RespawnDisabled = true)
    {
        new str[128];
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, killerid);
        IsPlayerSpectating[playerid] = true;
        format(str, 128, "~n~~n~~n~~n~~n~~n~~n~~n~~g~Spectating: ~w~%s(ID:%d)",    GetName(SpectatedPlayer[playerid]), SpectatedPlayer[playerid]);
        GameTextForPlayer(playerid,str,10000,3);
  }
Errors (all about the 'if' line):
pawn Код:
error 076: syntax error in the expression, or invalid function call
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Way #2
pawn Код:
if(RespawnDisabled == true)
    {
        new str[128];
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, killerid);
        IsPlayerSpectating[playerid] = true;
        format(str, 128, "~n~~n~~n~~n~~n~~n~~n~~n~~g~Spectating: ~w~%s(ID:%d)",    GetName(SpectatedPlayer[playerid]), SpectatedPlayer[playerid]);
        GameTextForPlayer(playerid,str,10000,3);
  }
Error (About the 'if' line too):
pawn Код:
error 076: syntax error in the expression, or invalid function call
Help please?
Reply
#2

Ok, so is the "RespawnDisabled" define or bool?

Is it this:
pawn Код:
#define RespawnDisabled          true
or this:
pawn Код:
new bool:RespawnDisabled;
Reply
#3

Quote:
Originally Posted by fiki574_CRO
Посмотреть сообщение
Ok, so is the "RespawnDisabled" define or bool?

Is it this:
pawn Код:
#define RespawnDisabled          true
or this:
pawn Код:
new bool:RespawnDisabled;
bool.
Reply
#4

Try this:
pawn Код:
if(bool:RespawnDisabled == true)
{
        new str[128];
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, killerid);
        IsPlayerSpectating[playerid] = true;
        format(str, 128, "~n~~n~~n~~n~~n~~n~~n~~n~~g~Spectating: ~w~%s(ID:%d)",    GetName(SpectatedPlayer[playerid]), SpectatedPlayer[playerid]);
        GameTextForPlayer(playerid,str,10000,3);
}
Reply
#5

Quote:
Originally Posted by fiki574_CRO
Посмотреть сообщение
Try this:
pawn Код:
if(bool:RespawnDisabled == true)
{
        new str[128];
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, killerid);
        IsPlayerSpectating[playerid] = true;
        format(str, 128, "~n~~n~~n~~n~~n~~n~~n~~n~~g~Spectating: ~w~%s(ID:%d)",    GetName(SpectatedPlayer[playerid]), SpectatedPlayer[playerid]);
        GameTextForPlayer(playerid,str,10000,3);
}
Nope still showing me the same error
Reply
#6

Show me where you define this:
pawn Код:
IsPlayerSpectating[playerid] = true;
Reply
#7

Quote:
Originally Posted by fiki574_CRO
Посмотреть сообщение
Show me where you define this:
pawn Код:
IsPlayerSpectating[playerid] = true;
pawn Код:
new bool:IsPlayerSpectating[MAX_PLAYERS];
Reply
#8

Try this then:

pawn Код:
//replace your current bools
new bool:IsPlayerSpectating[MAX_PLAYERS] = false;
new bool:RespawnDisabled = true;
pawn Код:
if(bool:RespawnDisabled == true)
{
        new str[128];
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, killerid);
        IsPlayerSpectating[playerid] = true; //this line could cause the error
        //OR\\
        bool:IsPlayerSpectating[playerid] = true; //dont use both lines, just comment one
        format(str, 128, "~n~~n~~n~~n~~n~~n~~n~~n~~g~Spectating: ~w~%s(ID:%d)",    GetName(SpectatedPlayer[playerid]), SpectatedPlayer[playerid]);
        GameTextForPlayer(playerid,str,10000,3);
}
Reply
#9

if(bool:RespawnDisabled == true)

Just dont do this, it makes no sense.

Show us the code before that if statement.
Reply
#10

Quote:
Originally Posted by kirk
Посмотреть сообщение
if(bool:RespawnDisabled == true)

Just dont do this, it makes no sense.

Show us the code before that if statement.
The other codes in the public or everything related to that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)