23.03.2014, 08:49
Thanks for the reply.
I used else if in the second statement and it worked, everything is working except the weapon set item.
The last option does not open the weaponset dialog. It re-opens the /settings menu (I want it to happen only with the first four options not with the last)
I used else if in the second statement and it worked, everything is working except the weapon set item.
pawn Код:
if (dialogid == DIALOG_SETTINGS)
{
if (!response) return 1;
if (response)
{
switch (listitem)
{
case 0:
{
if (Nitro[playerid] == 1)
{
Nitro[playerid] = 0;
}
else if (Nitro[playerid] == 0)
{
Nitro[playerid] = 1;
}
}
case 1:
{
if (AutoFix[playerid] == 1)
{
AutoFix[playerid] = 0;
}
else if (AutoFix[playerid] == 0)
{
AutoFix[playerid] = 1;
}
}
case 2:
{
if (Bounce[playerid] == 1)
{
Bounce[playerid] = 0;
}
else if (Bounce[playerid] == 0)
{
Bounce[playerid] = 1;
}
}
case 3:
{
if (AntifallEnabled[playerid] == 1)
{
AntifallEnabled[playerid] = 0;
}
else if (AntifallEnabled[playerid] == 0)
{
AntifallEnabled[playerid] = 1;
}
}
case 4:
{
ShowPlayerDialog( playerid, WEAPONSET, DIALOG_STYLE_LIST, "{58C8ED}Weapon Set", ""ORANGE"Standard Weapon Set \n"ORANGE"Advanced Weapon Set {33AA33}($30000)\n"ORANGE"Expert Weapon Set {33AA33}($60000)", "Select", "Cancel" );
}
}
new string[300];
new SBstring[30];
if (Nitro[playerid] == 1) format(SBstring, 30, ""C_RED"Disable"C_WHITE"");
if (Nitro[playerid] == 0) format(SBstring, 30, ""C_GREEN"Enable"C_WHITE"");
new AutoFixString[30];
if (AutoFix[playerid] == 1) format(AutoFixString, 30, ""C_RED"Disable"C_WHITE"");
if (AutoFix[playerid] == 0) format(AutoFixString, 30, ""C_GREEN"Enable"C_WHITE"");
new BounceString[30];
if (Bounce[playerid] == 1) format(BounceString, 30, ""C_RED"Disable"C_WHITE"");
if (Bounce[playerid] == 0) format(BounceString, 30, ""C_GREEN"Enable"C_WHITE"");
new AFstring[30];
if (AntifallEnabled[playerid] == 1) format(AFstring, 30, ""C_RED"Disable"C_WHITE"");
if (AntifallEnabled[playerid] == 0) format(AFstring, 30, ""C_GREEN"Enable"C_WHITE"");
new WeaponSetString[30];
if (PlayerInfo[playerid][WeaponSet] == 0) format(WeaponSetString, 30, ""ORANGE"Standard"C_WHITE"");
if (PlayerInfo[playerid][WeaponSet] == 1) format(WeaponSetString, 30, ""ORANGE"Advanced"C_WHITE"");
if (PlayerInfo[playerid][WeaponSet] == 2) format(WeaponSetString, 30, ""ORANGE"Expert"C_WHITE"");
format(string, 300, "Speedboost (%s)\nAuto Repair (%s)\nBounce (%s)\nAntifall (%s)\nWeapon Set (%s)", SBstring, AutoFixString, BounceString, AFstring, WeaponSetString);
ShowPlayerDialog(playerid, DIALOG_SETTINGS, DIALOG_STYLE_LIST, ""REDORANGE">> "C_WHITE"Account Settings", string, "OK", "Cancel");
}
}