error 010: invalid function or declaration - 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)
+--- Thread: error 010: invalid function or declaration (
/showthread.php?tid=605568)
error 010: invalid function or declaration -
PrednizoN - 21.04.2016
Error to from 338. line
Код:
COMMAND:spyex(playerid, params[])
{
if(gTeam[playerid] == TEAM_EURASIA)
{
SetPlayerSkin(playerid, 73);
}
else if(gTeam[playerid] == TEAM_SOVIET)
{
SetPlayerSkin(playerid, 285);
}
else if(gTeam[playerid] == TEAM_AUS)
{
SetPlayerSkin(playerid, 206);
}
else if(gTeam[playerid] == TEAM_ARAB)
{
SetPlayerSkin(playerid, 254);
}
else if(gTeam[playerid] == TEAM_USA)
{
SetPlayerSkin(playerid, 287);
}
}
return 1;
338;
Re: error 010: invalid function or declaration -
introzen - 21.04.2016
Put return inside the command.
PHP код:
COMMAND:spyex(playerid, params[])
{
if(gTeam[playerid] == TEAM_EURASIA)
{
SetPlayerSkin(playerid, 73);
}
else if(gTeam[playerid] == TEAM_SOVIET)
{
SetPlayerSkin(playerid, 285);
}
else if(gTeam[playerid] == TEAM_AUS)
{
SetPlayerSkin(playerid, 206);
}
else if(gTeam[playerid] == TEAM_ARAB)
{
SetPlayerSkin(playerid, 254);
}
else if(gTeam[playerid] == TEAM_USA)
{
SetPlayerSkin(playerid, 287);
}
return 1;
}
If I had a computer I would change the code for you so it uses a switch instead, but I'm on the cell now so you can do that yourself.
Re: error 010: invalid function or declaration -
xTURBOx - 21.04.2016
PHP код:
COMMAND:spyex(playerid,params[])
{
switch(gTeam[playerid])
{
case TEAM_EURASIA : SetPlayerSkin(playerid, 73);
case TEAM_SOVIET : SetPlayerSkin(playerid, 285);
case TEAM_AUS : SetPlayerSkin(playerid, 206);
case TEAM_ARAB : SetPlayerSkin(playerid, 254);
case TEAM_USA : SetPlayerSkin(playerid, 287);
}
}