20.01.2012, 21:43
I think this is what your looking for;
Basically when you click a class, it brings up a new dialog showing all the information. if you click choose it sets you with that class's health/skin/weapons ect. obviously you just add your stuff in there...
don't forget to +rep
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_CLASS) { if(!response) return ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose your class", "Class 1\nClass 2\nClass 3", "Choose", ""); switch(listitem) { case 0: { ShowPlayerDialog(playerid, Class1, DIALOG_STYLE_MSGBOX, "Class 1 information", "Information...", "Choose", "Cancel"); } case 1: { ShowPlayerDialog(playerid, Class2, DIALOG_STYLE_MSGBOX, "Class 2 information", "Information...", "Choose", "Cancel"); } case 2: { ShowPlayerDialog(playerid, Class3, DIALOG_STYLE_MSGBOX, "Class 3 information", "Information...", "Choose", "Cancel"); } } } if(dialogid == Class1) { if(response) { GivePlayerWeapon(playerid, 23, 200); SetPlayerHealth(playerid, 100); SetPlayerSkin(playerid, 8); } else return ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose your class", "Class 1\nClass 2\nClass 3", "Choose", ""); } if(dialogid == Class2) { if(response) { GivePlayerWeapon(playerid, 23, 200); SetPlayerHealth(playerid, 100); SetPlayerSkin(playerid, 8); } else return ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose your class", "Class 1\nClass 2\nClass 3", "Choose", ""); } if(dialogid == Class3) { if(response) { GivePlayerWeapon(playerid, 23, 200); SetPlayerHealth(playerid, 100); SetPlayerSkin(playerid, 8); } else return ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose your class", "Class 1\nClass 2\nClass 3", "Choose", ""); } return 1; }
don't forget to +rep