Why i got this error?
#1

Why i got this error?
Код:
E:\sa-mp servers\gamemodes\wwrrp.pwn(340) : error 029: invalid expression, assumed zero
Heres the code:
pawn Код:
if(gTeam[playerid] != TEAM_COP)
All code:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 596)
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 597)
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 598)
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 599)
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 522)
{
if(gTeam[playerid] != TEAM_COP)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xFF0000AA, "You are not a cop");
return 1;
}
}
}
return 1;
}
Reply
#2

Its not enough. Show us where you define TEAM_COP.


My guess is that the script is expecting a strval and you're giving it a float or a string. But that's a blind guess.


I don't usually harass people for indentation.
Reply
#3

pawn Код:
#define TEAM_COP
Reply
#4


[#define TEAM_COP

#define TEAM_COP 1



Provided you don't have a Team 1, you'll be just fine. Remember the script is translating words to integers (strval) or characters (string). So give it a strval to work with.

For your next team you would do this:

Код:
#define TEAM_ROBBER 2
Reply
#5

Why i got this one?

Код:
E:\sa-mp servers\gamemodes\wwrrp.pwn(235) : warning 235: public function lacks forward declaration (symbol "SetPlayerTeamFromClass")
All Code:

pawn Код:
public SetPlayerTeamFromClass(playerid, classid)
{
  if (classid == 0)
  {
    gTeam[playerid] = TEAM_COP;
  }
}
Only specifice place:

pawn Код:
public SetPlayerTeamFromClass(playerid, classid)
Reply
#6

Hmm not sure try adding this line:

gClass[playerid] = classid;
Reply
#7

that dont work! The error is in this!

pawn Код:
public SetPlayerTeamFromClass(playerid, classid)
Reply
#8

Can you show me the full code?
Reply
#9

um.. its a game mode whit a - 10678 lines
Reply
#10

forward SetPlayerTeamFromClass(playerid, classid);


up at the top with the other forward declarations.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)