SA:MP - Pawno - [TUT] Menu pre sa-mp 0.2.2 Roman Lipka | 21.08.2008
Dnes se podíváme na MENU funkci samp 0.2.2 -->>Index
kód:
new Menu:xmenu;OnPlayerCommandText
kód:
new cmd[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmdtext, "/xmenu",true)==0 || strcmp(cmdtext, "/x", true) == 0){
xmenu = CreateMenu("xmenu",1,20,220,90,60);
AddMenuItem(xmenu,0,"Polozka1");
AddMenuItem(xmenu,0,"Polozka2");
AddMenuItem(xmenu,0,"Polozka3");
ShowMenuForPlayer(xmenu,playerid);
return 1;
}
OnPlayerSelectedMenuRow
kód:
new string[100];
new Menu:Current = GetPlayerMenu(playerid);
if (Current == xmenu ) {
switch(row) {
case 0:{SendClientMessage(playerid, COLOR_**, "Polozka1 vybrana");
//Sem se da umistit jakykoliv script pr. GivePLayerWeapon atp.
}
case 1:{SendClientMessage(playerid, COLOR_**, "Polozka2 vybrana");}
case 2:{SendClientMessage(playerid, COLOR_**, "Polozka3 vybrana");}}}
return 1;
}
TUTORIAL By MaverickCZE