23.03.2014, 08:28
pawn Код:
CMD:settings (playerid)
{
if (PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"You must be logged in!");
if (PlayerInfo[playerid][inDM] == 1) return SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"You cannot access the settings menu in a DM arena! Please /leave to proceed.");
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");
return 1;
}
pawn Код:
if (dialogid == DIALOG_SETTINGS)
{
if (!response) return 1;
if (response)
{
switch (listitem)
{
case 0:
{
if (Nitro[playerid] == 1)
{
Nitro[playerid] = 0;
}
if (Nitro[playerid] == 0)
{
Nitro[playerid] = 1;
}
}
case 1:
{
if (AutoFix[playerid] == 1)
{
AutoFix[playerid] = 0;
}
if (AutoFix[playerid] == 0)
{
AutoFix[playerid] = 1;
}
}
case 2:
{
if (Bounce[playerid] == 1)
{
Bounce[playerid] = 0;
}
if (Bounce[playerid] == 0)
{
Bounce[playerid] = 1;
}
}
case 3:
{
if (AntifallEnabled[playerid] == 1)
{
AntifallEnabled[playerid] = 0;
}
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");
}
}