SA-MP Forums Archive
Error with Teams - 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 with Teams (/showthread.php?tid=539025)



Error with Teams - Jigsaw123 - 25.09.2014

This is the error:
Код:
C:\Users\USER\Desktop\Sv\gamemodes\rp.pwn(454 -- 455) : error 029: invalid expression, assumed zero
C:\Users\USER\Desktop\Sv\gamemodes\rp.pwn(474) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\USER\Desktop\Sv\gamemodes\rp.pwn(474) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Lines 454 - 474
Код:
		case DIALOG_ARMY
		{
		    if(!response)
		    {
  				SendClientMessageEx(playerid, COLOR_WHITE, "SERVER: You have been kicked out of the server because you failed to respond.");
		        Kick(playerid);
		    }
		    switch(listitem)
		    {
		        case 0:
		        {
                SetPlayerTeam(playerid,1);
                SetPlayerSkin(playerid,287);
                }
                case 1:
                {
                SetPlayerTeam(playerid,2);
                SetPlayerSkin(playerid,285);
                }

				ShowPlayerDialogEx(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "Gender Selection", "Male\nFemale", "Select", "Quit");



Re: Error with Teams - MikeEd - 25.09.2014

I dont know what you are using and that "ShowPlayerDialog" at the end is just ... wrong. Here's a small fix
pawn Код:
if(dialogid == DIALOG_ARMY)
{
if(!response)
{
    SendClientMessageEx(playerid, COLOR_WHITE, "SERVER: You have been kicked out of the server because you failed to respond.");
    Kick(playerid);
}
switch(listitem)
{
    case 0:
    {
        SetPlayerTeam(playerid,1);
        SetPlayerSkin(playerid,287);
    }
    case 1:
    {
     SetPlayerTeam(playerid,2);
     SetPlayerSkin(playerid,285);
    }
}
If you need more help, provided a little bit more code.