29.07.2009, 16:27
i whanted something like this
ok thats to bring up the menu
ok i dont think this would work
Код:
see i need something like this .... // this is for just makeing the menu come up :) lol so much work :P
Код:
//top of script Forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z); Forward shops(playerid); new Menu:shopsmenu; new Menu:CurrentMenu = GetPlayerMenu(playerid);
Код:
// ongamemodeint SetPlayerCheckpoint(playerid, x,y,z); shopsmenu = CreateMenu("shopsmenu", 2, x,y,z);
Код:
//new (at bottem of script) public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z) { new Float:oldposx, Float:oldposy, Float:oldposz; new Float:tempposx, Float:tempposy, Float:tempposz; GetPlayerPos(playerid, oldposx, oldposy, oldposz); tempposx = (oldposx -x); tempposy = (oldposy -y); tempposz = (oldposz -z); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } return 0; publick shops (playerid) if (PlayerToPoint(3.0, playerid,x,y,z)) { ShowMenuForPlayer(shopmenu,playerid); } return 1; }
Код:
// this is to set the menu AddMenuItem(teleportmenu, 0, "1. 5 seeds"); AddMenuItem(teleportmenu, 0, "2. condom"); AddMenuItem(teleportmenu, 0, "3. deer trap"); AddMenuItem(teleportmenu, 0, "4. hunting license"); AddMenuItem(teleportmenu, 0, "5. fishing license"); AddMenuItem(teleportmenu, 0, "6. something ..."); if(CurrentMenu == teleportmenu) { switch(row) { case 0: { } case 1: { } case 2: { } case 3: { } case 4: { } case 5: { } } }