01.06.2009, 14:53
hi i need help how to add a menu item at this code?
please help i whant add a menu item so if the ppl selected a menu item they push shift then they teleport to that place how to do that please help
ty alot
P.S sorry for my bad english im Netherlands
pawn Код:
#include <a_samp>
#define TEST_MENU_ITEMS 6
new Menu:TestMenu;
new TestMenuStrings[6][16] = {"Test1", "Test2", "Test3", "Test4", "Test5", "Test6"};
HandleTestMenuSelection(playerid, row)
{
new s[256];
if(row < TEST_MENU_ITEMS) {
format(s,256,"You selected item %s",TestMenuStrings[row]);
SendClientMessage(playerid,0xFFFFFFFF,s);
}
}
InitTestMenu()
{
TestMenu = CreateMenu("Test Menu", 1, 200.0, 150.0, 200.0, 200.0);
for(new x=0; x < TEST_MENU_ITEMS; x++) {
AddMenuItem(TestMenu, 0, TestMenuStrings[x]);
}
}
public OnFilterScriptInit()
{
InitTestMenu();
}
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:PlayerMenu = GetPlayerMenu(playerid);
if(PlayerMenu == TestMenu) {
HandleTestMenuSelection(playerid, row);
}
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/menutest", true)) {
ShowMenuForPlayer(TestMenu, playerid);
return 1;
}
return 0;
}
ty alot
P.S sorry for my bad english im Netherlands