Error with Teams
#1

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");
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)