20.01.2012, 15:03
This dialog:
Shows every time when a player is death. How can I fix that?
Код:
public OnPlayerSpawn(playerid) { ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose your Class", "Class 1\nClass 2\nClass 3", "Choose", ""); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_CLASS) { if(!response) // if player presses ESC re-show the dialog return ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose your class", "Class 1\nClass 2\nClass 3", "Choose", ""); switch(listitem) { case 0: if(gTeam[playerid] == TEAM_USA) { SendClientMessage(playerid, COLOR_BLUE, "*You chose the Soldier Class!"); GivePlayerWeapon(playerid, 4, 0); GivePlayerWeapon(playerid, 22, 25); GivePlayerWeapon(playerid, 16, 2); GivePlayerWeapon(playerid, 31, 100); } else if(gTeam[playerid] == TEAM_USA) { SendClientMessage(playerid, COLOR_BLUE, "*You chose the Soldier Class!"); GivePlayerWeapon(playerid, 4, 0); GivePlayerWeapon(playerid, 22, 25); GivePlayerWeapon(playerid, 16, 2); GivePlayerWeapon(playerid, 31, 100); } else if(gTeam[playerid] == TEAM_USA) { SendClientMessage(playerid, COLOR_BLUE, "*You chose the Soldier Class!"); GivePlayerWeapon(playerid, 4, 0); GivePlayerWeapon(playerid, 22, 25); GivePlayerWeapon(playerid, 16, 2); GivePlayerWeapon(playerid, 31, 100); } case 1: { SendClientMessage(playerid, COLOR_BLUE, "*you choose the soldier class.."); GivePlayerWeapon(playerid, 34, 12); GivePlayerWeapon(playerid, 23, 25); GivePlayerWeapon(playerid, 25, 15); } case 2: { // CLASS 3 // stuff for class 3 } // etc } } return 0; }