1 error very simple help me - 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: 1 error very simple help me (
/showthread.php?tid=275836)
1 error very simple help me -
Davz*|*Criss - 11.08.2011
Hey guys so you can understand what i am currently creating.
here is my code:
and on top:
pawn Код:
public Dday(playerid)
{
switch(dday)
{
case 0:
{
SetPlayerTeam(playerid, 0);
SetPlayerColor(playerid, 0xFF0000FF); // Red
SetPlayerVirtualWorld(playerid, 3);
GameTextForPlayer(playerid,"You're ~r~Attacker. ~g~Go Attack them..",2000,3);
}
case 1:
{
SetPlayerTeam(playerid, 1);
SetPlayerColor(playerid, 0x00FF00FF); // Green
SetPlayerVirtualWorld(playerid, 3);
GameTextForPlayer(playerid,"You're ~g~Defender. ~g~Go Defend them..",2000,3);
}
return dday;
}
and the errors:
Код:
C:\Users\Axme\Desktop\Server\gamemodes\Hydraffs.pwn(676) : error 002: only a single statement (or expression) can follow each "case"
Line 676 = return dday;
thanks
Re: 1 error very simple help me -
Jay. - 11.08.2011
pawn Код:
public Dday(playerid)
{
switch(dday)
{
case 0:
{
SetPlayerTeam(playerid, 0);
SetPlayerColor(playerid, 0xFF0000FF); // Red
SetPlayerVirtualWorld(playerid, 3);
GameTextForPlayer(playerid,"You're ~r~Attacker. ~g~Go Attack them..",2000,3);
}
case 1:
{
SetPlayerTeam(playerid, 1);
SetPlayerColor(playerid, 0x00FF00FF); // Green
SetPlayerVirtualWorld(playerid, 3);
GameTextForPlayer(playerid,"You're ~g~Defender. ~g~Go Defend them..",2000,3);
}
}
return dday;
}
You forgot a bracket for the switch.
Re: 1 error very simple help me -
Sascha - 11.08.2011
you forgot a }
pawn Код:
public Dday(playerid)
{
switch(dday)
{
case 0:
{
SetPlayerTeam(playerid, 0);
SetPlayerColor(playerid, 0xFF0000FF); // Red
SetPlayerVirtualWorld(playerid, 3);
GameTextForPlayer(playerid,"You're ~r~Attacker. ~g~Go Attack them..",2000,3);
}
case 1:
{
SetPlayerTeam(playerid, 1);
SetPlayerColor(playerid, 0x00FF00FF); // Green
SetPlayerVirtualWorld(playerid, 3);
GameTextForPlayer(playerid,"You're ~g~Defender. ~g~Go Defend them..",2000,3);
}
} //-- here
return dday;
}
edit: hm jay was faster
Re: 1 error very simple help me -
Davz*|*Criss - 11.08.2011
Oh thank you both.
This helped me lol.
Thanks