Brackets
#1

Hi,
Can anyone tell me where are the brackets missing in the code given below

Код:
  if(dialogid == DIALOG_FREESHOP)
        {
             if(response)
            {
                if (playerData[playerid][playerVIPLevel] >= 3)
                {
	                case 1:
	                {
	                     GivePlayerWeaponEx(playerid, WEAPON_CHAINSAW, 1);
	                }
	                case 2:
	                {
	                GivePlayerWeaponEx(playerid, WEAPON_DEAGLE, 6000);
	                }
	                case 3:
	                {
	                GivePlayerWeaponEx(playerid, WEAPON_SAWEDOFF, 6000);
	                }
	                case 4:
	                {
	                GivePlayerWeaponEx(playerid, WEAPON_AK47, 6000);
	                }
	                case 5:
	                {
	                GivePlayerWeaponEx(playerid, WEAPON_SNIPER, 6000);
	                }
	                case 6:
	                {
	                GivePlayerWeaponEx(playerid, WEAPON_PARACHUTE, 1);
					}
	            }
			}
			return 1;
        }
Reply
#2

You forget to add this switch(listitem)

Код:
if (dialogid == DIALOG_FREESHOP)
{
	if (response)
	{
		if (playerData[playerid][playerVIPLevel] >= 3)
		{
			switch(listitem)
   			{
				case 1: GivePlayerWeaponEx(playerid, WEAPON_CHAINSAW, 1);
				case 2: GivePlayerWeaponEx(playerid, WEAPON_DEAGLE, 6000);
				case 3: GivePlayerWeaponEx(playerid, WEAPON_SAWEDOFF, 6000);
				case 4: GivePlayerWeaponEx(playerid, WEAPON_AK47, 6000);
				case 5: GivePlayerWeaponEx(playerid, WEAPON_SNIPER, 6000);
				case 6: GivePlayerWeaponEx(playerid, WEAPON_PARACHUTE, 1);
			}
		}
	}
}
Reply
#3

same issue.. The pawno crashes
Reply
#4

There is no missing brackets here. Check other codes.
Reply
#5

this code causes the pawno to crash
Reply
#6

Quote:
Originally Posted by TeKno
Посмотреть сообщение
this code causes the pawno to crash
Server chatlog may help?
Reply
#7

Where did you place this code?
Reply
#8

ondialogresponse
Reply
#9

Show the full code, including the codes outside OnDialogResponse.

Aswell as, show the definition of the WEAPON_x variables and the GivePlayerWeaponEx function.
Reply
#10

there is a problem in this code... the code compiles easily if i remove this piece
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)