30.03.2014, 20:21
The indentation is not the main problem here. The forum fucked it up a bit with the [code] tags
I changed the code to this:
I added the returns but still I am experiencing the same problem.
This is the /locker command:
I changed the code to this:
Код:
if(dialogid == DIALOG_LOCKER) { if(response) { if(listitem == 0) { ShowPlayerDialog(playerid, DIALOG_LUBELT, DIALOG_STYLE_LIST, "Welcome to the --- locker!", "Baton \nDesert Eagle \nPepperspray \nBack", "Select", "Exit"); return 1; } if(listitem == 1) { ShowPlayerDialog(playerid, DIALOG_LHEAVY, DIALOG_STYLE_LIST, "Welcome to the --- locker!", "Shotgun \nBack", "Select", "Exit"); return 1; } if(listitem == 2) { ShowPlayerDialog(playerid, DIALOG_LMELEE, DIALOG_STYLE_LIST, "Welcome to the --- locker!", "Baton \nPepperspray \nBack", "Select", "Exit"); return 1; } if(listitem == 3) { GivePlayerWeapon(playerid, 43, 100); ShowPlayerDialog(playerid, DIALOG_LOCKER, DIALOG_STYLE_LIST, "Welcome to the --- locker!", "Utility belt \nRifles \nMelee weapons \nCamera \nFirst Aid Kit \nArmour", "Select", "Exit"); return 1; } if(listitem == 4) { SetPlayerHealth(playerid, 100); ShowPlayerDialog(playerid, DIALOG_LOCKER, DIALOG_STYLE_LIST, "Welcome to the --- locker!", "Utility belt \nRifles \nMelee weapons \nCamera \nFirst Aid Kit \nArmour", "Select", "Exit"); return 1; } if(listitem == 5) { SetPlayerArmour(playerid, 50); ShowPlayerDialog(playerid, DIALOG_LOCKER, DIALOG_STYLE_LIST, "Welcome to the --- locker!", "Utility belt \nRifles \nMelee weapons \nCamera \nFirst Aid Kit \nArmour", "Select", "Exit"); return 1; } } }
This is the /locker command:
Код:
if(strcmp(cmdtext, "/locker", true) == 0) { if(IsPlayerInRangeOfPoint(playerid, 5.0, 253.9568,76.8493,1003.6406)) { ShowPlayerDialog(playerid, DIALOG_LOCKER, DIALOG_STYLE_LIST, "Welcome to the --- locker!", "Utility belt \nRifles \nMelee weapons \nCamera \nFirst Aid Kit \nArmour", "Select", "Exit"); return 1; } else { SendClientMessage(playerid, COLOR_RED, "[NOTE] You're not in range of the LSPD locker!"); } return 1; }