Dialog shows every time on death
#1

This dialog:
Код:
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;
}
Shows every time when a player is death. How can I fix that?
Reply


Messages In This Thread
Dialog shows every time on death - by MSI - 20.01.2012, 15:03
Re: Dialog shows every time on death - by Chris White - 20.01.2012, 15:11
Re: Dialog shows every time on death - by [XST]O_x - 20.01.2012, 15:20
Re: Dialog shows every time on death - by Konstantinos - 20.01.2012, 15:28
Re: Dialog shows every time on death - by MSI - 20.01.2012, 15:55
Re: Dialog shows every time on death - by MSI - 20.01.2012, 16:05
Re: Dialog shows every time on death - by Konstantinos - 20.01.2012, 16:10
Re: Dialog shows every time on death - by MSI - 20.01.2012, 16:12
Re: Dialog shows every time on death - by MSI - 20.01.2012, 16:44
Re: Dialog shows every time on death - by Konstantinos - 20.01.2012, 16:50

Forum Jump:


Users browsing this thread: 3 Guest(s)