Why i got this error? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Why i got this error? (
/showthread.php?tid=72702)
Why i got this error? -
krisis32 - 10.04.2009
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;
}
Re: Why i got this error? -
Frank_Tesla - 10.04.2009
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.
Re: Why i got this error? -
krisis32 - 10.04.2009
Re: Why i got this error? -
Frank_Tesla - 10.04.2009
[#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
Re: Why i got this error? -
krisis32 - 10.04.2009
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)
Re: Why i got this error? -
GTA_Rules - 10.04.2009
Hmm not sure try adding this line:
gClass[playerid] = classid;
Re: Why i got this error? -
krisis32 - 10.04.2009
that dont work! The error is in this!
pawn Код:
public SetPlayerTeamFromClass(playerid, classid)
Re: Why i got this error? -
GTA_Rules - 10.04.2009
Can you show me the full code?
Re: Why i got this error? -
krisis32 - 10.04.2009
um.. its a game mode whit a - 10678 lines
Re: Why i got this error? -
Frank_Tesla - 11.04.2009
forward SetPlayerTeamFromClass(playerid, classid);
up at the top with the other forward declarations.