CASE_CLASS ERROR
#1

Код:
C:\Users\Antonio\Desktop\SA-MP Server\gamemodes\gmbeta.pwn(1887) : error 014: invalid statement; not in switch
C:\Users\Antonio\Desktop\SA-MP Server\gamemodes\gmbeta.pwn(1887) : warning 215: expression has no effect
C:\Users\Antonio\Desktop\SA-MP Server\gamemodes\gmbeta.pwn(1887) : error 001: expected token: ";", but found ":"
C:\Users\Antonio\Desktop\SA-MP Server\gamemodes\gmbeta.pwn(1887) : error 029: invalid expression, assumed zero
C:\Users\Antonio\Desktop\SA-MP Server\gamemodes\gmbeta.pwn(1887) : fatal error 107: too many error messages on one line
SCRIPT
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_GREY"REGISTER",""COL_WHITE"Dobro dosao na server.\nVas profil nije pronaden.\nKako bi igrali morate se registrirati\nUnesite zeljenu lozinku da se registrirate.","Register","Izadi");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"VIP",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Banned",0);
                INI_WriteInt(File,"Scores",0);
                GivePlayerCash(playerid, 100);
                PlayerInfo[playerid][pAdmin] = 0;
                PlayerInfo[playerid][pVIP] = 0;
                INI_Close(File);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_GREY"REGISTER",""COL_WHITE"Uspjesno ste se registrirali!\nNa serveru postoje pravila koja se moraju postivati.\nDa vidite listu pravila kucajte /rules\nAko vam treba pomoc kucajte /help.\n Pritisnite spawn da se spawnate.","Ok","");
			}
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
                    SetPlayerScore(playerid,PlayerInfo[playerid][pScores]);
					ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_GREY"LOGIN",""COL_GREEN"Uspjesno ste se ulogirali!\n"COL_RED"OBAVIJESTI: "COL_WHITE"Server je trenutno u radnji!\n"COL_RED"0.3 VERZIJA:"COL_WHITE"SLozeno dosta bugova i ubaceno novih stvari.\nPritisni spawn da se spawnas","Ok","");
                    SpawnPlayer(playerid);
			    }

                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_GREY"LOGIN",""COL_WHITE"Dobro dosao na server.\nVas profil je pronaden.\nUnesite vasu lozinku da se logirate.","Login","Izadi");
                }
                return 1;
            }
        }
    }
    
    
    case DIALOG_CLASS:
    {
    if(dialogid == 6)
 			{
			    if(response)
			    	{

						if(GetPlayerScore(playerid) <= 0)//Private
						{

						SetPlayerSkin(playerid, 287);
						SendClientMessage(playerid, COLOR_WHITE, "You chose the assault as your class.");
			            SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
			            gPlayerClass[playerid] = ASSAULT_CLASS;
			            PickedClass[playerid] = 1;
			            SetPlayerVirtualWorld(playerid, 0);
						TogglePlayerControllable(playerid, 1);
						GivePlayerWeapon(playerid, 24, 200);
						GivePlayerWeapon(playerid, 31, 500);
						GivePlayerWeapon(playerid, 17, 5);
						}
						}


                if(listitem == 1)//sniper DONE
			        {
						if(GetPlayerScore(playerid) <= 10)//Private

						{

							SetPlayerSkin(playerid, 122);
			         		SendClientMessage(playerid, COLOR_WHITE, "You chose the Sniper as your class.");
				            SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
				            gPlayerClass[playerid] = SNIPER_CLASS;
				            PickedClass[playerid] = 1;
				            SetPlayerVirtualWorld(playerid, 0);
				            TogglePlayerControllable(playerid, 1);
							GivePlayerWeapon(playerid, 23, 500);
						    GivePlayerWeapon(playerid, 34, 100);
						    GivePlayerWeapon(playerid, 29, 200);

					}
                        else
					{
						SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Private class [/rank to see yours]");
   						TogglePlayerControllable(playerid, 0);
					}
				}


				if(listitem == 2)//pilot DONE
			        {
							if(GetPlayerScore(playerid) <= 1150)//Lieutenant Colonel

							{

							SetPlayerSkin(playerid, 61);
			         		SendClientMessage(playerid, COLOR_WHITE, "You chose the Pilot as your class.");
				            SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
				            gPlayerClass[playerid] = AIRMAN_CLASS;
				            PickedClass[playerid] = 1;
				            SetPlayerVirtualWorld(playerid, 0);
				            TogglePlayerControllable(playerid, 1);
						    GivePlayerWeapon(playerid, 22, 50);
						    GivePlayerWeapon(playerid, 29, 500);
						    GivePlayerWeapon(playerid, 16, 5);

					}
     						else
					{
						SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Lieutenant Colonel class [/rank to see yours]");
   						TogglePlayerControllable(playerid, 0);
					}
				}
			    if(listitem == 3)//Engineer
			        {
							if(GetPlayerScore(playerid) <= 250)//Sergeant

							{
                            SetPlayerSkin(playerid, 285);
     	    				SendClientMessage(playerid, COLOR_WHITE, "You chose the Engineer as your class.");
				            SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
				            gPlayerClass[playerid] = ENGINEER_CLASS;
				            PickedClass[playerid] = 1;
				            SetPlayerVirtualWorld(playerid, 0);
				            TogglePlayerControllable(playerid, 1);
						    GivePlayerWeapon(playerid, 22, 100);
						    GivePlayerWeapon(playerid, 32, 500);
						    GivePlayerWeapon(playerid, 35, 5);


					}
					        else
					{
						SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Sergeant class [/rank to see yours]");
   						TogglePlayerControllable(playerid, 0);
					}
				}

		        if(listitem == 4)//FlameThrower
			        {
							if(GetPlayerScore(playerid) <= 400)//CAPTAIN

							{

							SetPlayerSkin(playerid, 144);
			         		SendClientMessage(playerid, COLOR_WHITE, "You chose the Flamethrower as your class.");
				            SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
				            gPlayerClass[playerid] = FLAMETHROWER_CLASS;
				            PickedClass[playerid] = 1;
				            SetPlayerVirtualWorld(playerid, 0);
				            TogglePlayerControllable(playerid, 1);
						    GivePlayerWeapon(playerid, 24, 200);
						    GivePlayerWeapon(playerid, 30, 200);
						    GivePlayerWeapon(playerid, 37, 200);


					}
					        else
					{
						SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Captain class [/rank to see yours]");
   						TogglePlayerControllable(playerid, 0);
					}
				}
                return 1;
             }
          }
		}
return 1;
}
Reply
#2

Which or Where is Line 1887 ?
Reply
#3

Show Line 1887
Reply
#4

case DIALOG_CLASS:
Reply
#5

Replace it with :-
pawn Код:
case DIALOG_CLASS;
Reply
#6

C:\Users\Antonio\Desktop\SA-MP Server\gamemodes\gmbeta.pwn(1887) : error 014: invalid statement; not in switch
C:\Users\Antonio\Desktop\SA-MP Server\gamemodes\gmbeta.pwn(1887) : warning 215: expression has no effect

new errors
Reply
#7

An extra bracker made case DIALOG_CLASS: to be out of the switch statement.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) Kick(playerid);
            else
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_GREY"REGISTER",""COL_WHITE"Dobro dosao na server.\nVas profil nije pronaden.\nKako bi igrali morate se registrirati\nUnesite zeljenu lozinku da se registrirate.","Register","Izadi");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"VIP",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Banned",0);
                INI_WriteInt(File,"Scores",0);
                GivePlayerCash(playerid, 100);
                PlayerInfo[playerid][pAdmin] = 0;
                PlayerInfo[playerid][pVIP] = 0;
                INI_Close(File);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_GREY"REGISTER",""COL_WHITE"Uspjesno ste se registrirali!\nNa serveru postoje pravila koja se moraju postivati.\nDa vidite listu pravila kucajte /rules\nAko vam treba pomoc kucajte /help.\n Pritisnite spawn da se spawnate.","Ok","");
            }
            return 1;
        }
        case DIALOG_LOGIN:
        {
            if ( !response ) Kick ( playerid );
            else
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
                    SetPlayerScore(playerid,PlayerInfo[playerid][pScores]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_GREY"LOGIN",""COL_GREEN"Uspjesno ste se ulogirali!\n"COL_RED"OBAVIJESTI: "COL_WHITE"Server je trenutno u radnji!\n"COL_RED"0.3 VERZIJA:"COL_WHITE"SLozeno dosta bugova i ubaceno novih stvari.\nPritisni spawn da se spawnas","Ok","");
                    SpawnPlayer(playerid);
                }
                else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_GREY"LOGIN",""COL_WHITE"Dobro dosao na server.\nVas profil je pronaden.\nUnesite vasu lozinku da se logirate.","Login","Izadi");
            }
            return 1;
        }
        case DIALOG_CLASS:
        {
            if(response)
            {
                switch(listitem)
                {
                    case 0:
                    {
                        if(GetPlayerScore(playerid) <= 0)//Private
                        {
                           
                            SetPlayerSkin(playerid, 287);
                            SendClientMessage(playerid, COLOR_WHITE, "You chose the assault as your class.");
                            SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
                            gPlayerClass[playerid] = ASSAULT_CLASS;
                            PickedClass[playerid] = 1;
                            SetPlayerVirtualWorld(playerid, 0);
                            TogglePlayerControllable(playerid, 1);
                            GivePlayerWeapon(playerid, 24, 200);
                            GivePlayerWeapon(playerid, 31, 500);
                            GivePlayerWeapon(playerid, 17, 5);
                        }
                    }
                    case 1://sniper DONE
                    {
                        if(GetPlayerScore(playerid) <= 10)//Private
                        {
                            SetPlayerSkin(playerid, 122);
                            SendClientMessage(playerid, COLOR_WHITE, "You chose the Sniper as your class.");
                            SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
                            gPlayerClass[playerid] = SNIPER_CLASS;
                            PickedClass[playerid] = 1;
                            SetPlayerVirtualWorld(playerid, 0);
                            TogglePlayerControllable(playerid, 1);
                            GivePlayerWeapon(playerid, 23, 500);
                            GivePlayerWeapon(playerid, 34, 100);
                            GivePlayerWeapon(playerid, 29, 200);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Private class [/rank to see yours]");
                            TogglePlayerControllable(playerid, 0);
                        }
                    }
                    case 2://pilot DONE
                    {
                        if(GetPlayerScore(playerid) <= 1150)//Lieutenant Colonel
                        {
                            SetPlayerSkin(playerid, 61);
                            SendClientMessage(playerid, COLOR_WHITE, "You chose the Pilot as your class.");
                            SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
                            gPlayerClass[playerid] = AIRMAN_CLASS;
                            PickedClass[playerid] = 1;
                            SetPlayerVirtualWorld(playerid, 0);
                            TogglePlayerControllable(playerid, 1);
                            GivePlayerWeapon(playerid, 22, 50);
                            GivePlayerWeapon(playerid, 29, 500);
                            GivePlayerWeapon(playerid, 16, 5);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Lieutenant Colonel class [/rank to see yours]");
                            TogglePlayerControllable(playerid, 0);
                        }
                    }
                    case 3://Engineer
                    {
                        if(GetPlayerScore(playerid) <= 250)//Sergeant
                        {
                            SetPlayerSkin(playerid, 285);
                            SendClientMessage(playerid, COLOR_WHITE, "You chose the Engineer as your class.");
                            SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
                            gPlayerClass[playerid] = ENGINEER_CLASS;
                            PickedClass[playerid] = 1;
                            SetPlayerVirtualWorld(playerid, 0);
                            TogglePlayerControllable(playerid, 1);
                            GivePlayerWeapon(playerid, 22, 100);
                            GivePlayerWeapon(playerid, 32, 500);
                            GivePlayerWeapon(playerid, 35, 5);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Sergeant class [/rank to see yours]");
                            TogglePlayerControllable(playerid, 0);
                        }
                    }
                    case 4://FlameThrower
                    {
                        if(GetPlayerScore(playerid) <= 400)//CAPTAIN
                        {
                            SetPlayerSkin(playerid, 144);
                            SendClientMessage(playerid, COLOR_WHITE, "You chose the Flamethrower as your class.");
                            SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
                            gPlayerClass[playerid] = FLAMETHROWER_CLASS;
                            PickedClass[playerid] = 1;
                            SetPlayerVirtualWorld(playerid, 0);
                            TogglePlayerControllable(playerid, 1);
                            GivePlayerWeapon(playerid, 24, 200);
                            GivePlayerWeapon(playerid, 30, 200);
                            GivePlayerWeapon(playerid, 37, 200);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Captain class [/rank to see yours]");
                            TogglePlayerControllable(playerid, 0);
                        }
                    }
                }
            }
            return 1;
        }
    }
    return 0;
}
Reply
#8

now dont work command /switchclass..
Reply
#9

I changed few things because they were wrong.

I got the code you posted again and deleted only the extra parameter:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_GREY"REGISTER",""COL_WHITE"Dobro dosao na server.\nVas profil nije pronaden.\nKako bi igrali morate se registrirati\nUnesite zeljenu lozinku da se registrirate.","Register","Izadi");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"VIP",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Banned",0);
                INI_WriteInt(File,"Scores",0);
                GivePlayerCash(playerid, 100);
                PlayerInfo[playerid][pAdmin] = 0;
                PlayerInfo[playerid][pVIP] = 0;
                INI_Close(File);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_GREY"REGISTER",""COL_WHITE"Uspjesno ste se registrirali!\nNa serveru postoje pravila koja se moraju postivati.\nDa vidite listu pravila kucajte /rules\nAko vam treba pomoc kucajte /help.\n Pritisnite spawn da se spawnate.","Ok","");
            }
        }
       
        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
                    SetPlayerScore(playerid,PlayerInfo[playerid][pScores]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_GREY"LOGIN",""COL_GREEN"Uspjesno ste se ulogirali!\n"COL_RED"OBAVIJESTI: "COL_WHITE"Server je trenutno u radnji!\n"COL_RED"0.3 VERZIJA:"COL_WHITE"SLozeno dosta bugova i ubaceno novih stvari.\nPritisni spawn da se spawnas","Ok","");
                    SpawnPlayer(playerid);
                }
               
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_GREY"LOGIN",""COL_WHITE"Dobro dosao na server.\nVas profil je pronaden.\nUnesite vasu lozinku da se logirate.","Login","Izadi");
                }
                return 1;
            }
        }
       
       
        case DIALOG_CLASS:
        {
            if(dialogid == 6)
            {
                if(response)
                {
                   
                    if(GetPlayerScore(playerid) <= 0)//Private
                    {
                       
                        SetPlayerSkin(playerid, 287);
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the assault as your class.");
                        SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
                        gPlayerClass[playerid] = ASSAULT_CLASS;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 24, 200);
                        GivePlayerWeapon(playerid, 31, 500);
                        GivePlayerWeapon(playerid, 17, 5);
                    }
                }
               
               
                if(listitem == 1)//sniper DONE
                {
                    if(GetPlayerScore(playerid) <= 10)//Private
                   
                    {
                       
                        SetPlayerSkin(playerid, 122);
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Sniper as your class.");
                        SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
                        gPlayerClass[playerid] = SNIPER_CLASS;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 23, 500);
                        GivePlayerWeapon(playerid, 34, 100);
                        GivePlayerWeapon(playerid, 29, 200);
                       
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Private class [/rank to see yours]");
                        TogglePlayerControllable(playerid, 0);
                    }
                }
               
               
                if(listitem == 2)//pilot DONE
                {
                    if(GetPlayerScore(playerid) <= 1150)//Lieutenant Colonel
                   
                    {
                       
                        SetPlayerSkin(playerid, 61);
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Pilot as your class.");
                        SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
                        gPlayerClass[playerid] = AIRMAN_CLASS;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 22, 50);
                        GivePlayerWeapon(playerid, 29, 500);
                        GivePlayerWeapon(playerid, 16, 5);
                       
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Lieutenant Colonel class [/rank to see yours]");
                        TogglePlayerControllable(playerid, 0);
                    }
                }
                if(listitem == 3)//Engineer
                {
                    if(GetPlayerScore(playerid) <= 250)//Sergeant
                   
                    {
                        SetPlayerSkin(playerid, 285);
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Engineer as your class.");
                        SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
                        gPlayerClass[playerid] = ENGINEER_CLASS;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 22, 100);
                        GivePlayerWeapon(playerid, 32, 500);
                        GivePlayerWeapon(playerid, 35, 5);
                       
                       
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Sergeant class [/rank to see yours]");
                        TogglePlayerControllable(playerid, 0);
                    }
                }
               
                if(listitem == 4)//FlameThrower
                {
                    if(GetPlayerScore(playerid) <= 400)//CAPTAIN
                   
                    {
                       
                        SetPlayerSkin(playerid, 144);
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Flamethrower as your class.");
                        SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
                        gPlayerClass[playerid] = FLAMETHROWER_CLASS;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 24, 200);
                        GivePlayerWeapon(playerid, 30, 200);
                        GivePlayerWeapon(playerid, 37, 200);
                       
                       
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You need to be atleast Captain class [/rank to see yours]");
                        TogglePlayerControllable(playerid, 0);
                    }
                }
                return 1;
            }
        }
    }
    return 1;
}
And here's the wrong thing you need to fix:
pawn Код:
// ...
        case DIALOG_CLASS:
        {
            if(dialogid == 6)
            {
                if(response)
                {
                   
                    if(GetPlayerScore(playerid) <= 0)//Private
                    {
                       
                        SetPlayerSkin(playerid, 287);
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the assault as your class.");
                        SendClientMessage(playerid, COLOR_WHITE, "You can type /switchclass to change your class again.");
                        gPlayerClass[playerid] = ASSAULT_CLASS;
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        GivePlayerWeapon(playerid, 24, 200);
                        GivePlayerWeapon(playerid, 31, 500);
                        GivePlayerWeapon(playerid, 17, 5);
                    }
                }
               
               
                if(listitem == 1)//sniper DONE
                {
You don't need to check the dialogid, this is why you used switch. Add the rest of the code (of listitems) into the response block of code and use switch for the listitem instead of checking with if all the time.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)