Menü funktioniert nicht

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hab gerade mein erstes menü erstellt. Ich bekomm keine Errors/Warnings aber wenn ich etwas auswähle geschieht nix...


    Ganz oben:
    new buy[6];
    new Menu:shop;


    OnGameModeInit:
    buy[0]=CreatePickup(1212, 1, -27.6221,-89.8386,1003.5469, -1); //SBF:CBE
    buy[1]=CreatePickup(1212, 1, -28.6973,-185.1080,1003.5469, -1); //FYB:PS
    buy[2]=CreatePickup(1212, 1, 1.9158,-28.7629,1003.5494, -1); //BSS:Enter
    buy[3]=CreatePickup(1212, 1, -21.4040,-138.5021,1003.5469, -1); //BSN:Enter
    buy[4]=CreatePickup(1212, 1, -23.0022,-55.4412,1003.5469, -1); //Donuts
    buy[5]=CreatePickup(1212, 1, -30.4778,-28.7735,1003.5573, -1); //TDF:CBE

    shop = CreateMenu("24/7", 2, 200.0, 100.0, 150.0, 150.0);
    AddMenuItem(shop, 0, "Beer");
    AddMenuItem(shop, 0, "Wine");
    AddMenuItem(shop, 0, "Sprunk");
    AddMenuItem(shop, 0, "40z");
    AddMenuItem(shop, 0, "Ciga");
    AddMenuItem(shop, 0, "Spraycan");
    AddMenuItem(shop, 0, "Phone");
    AddMenuItem(shop, 0, "Lottery ticket");
    AddMenuItem(shop, 0, "Bat");
    AddMenuItem(shop, 0, "Exit");


    CMD:
    CMD:store(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,3,-30.4778,-28.7735,1003.5573))
    {
    ShowMenuForPlayer(shop, playerid);
    TogglePlayerControllable(playerid,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,3,-23.0022,-55.4412,1003.5469))
    {
    ShowMenuForPlayer(shop, playerid);
    TogglePlayerControllable(playerid,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,3,-21.4040,-138.5021,1003.5469))
    {
    ShowMenuForPlayer(shop, playerid);
    TogglePlayerControllable(playerid,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,3,1.9158,-28.7629,1003.5494))
    {
    ShowMenuForPlayer(shop, playerid);
    TogglePlayerControllable(playerid,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,3,-28.6973,-185.1080,1003.5469))
    {
    ShowMenuForPlayer(shop, playerid);
    TogglePlayerControllable(playerid,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,3,-27.6221,-89.8386,1003.5469))
    {
    ShowMenuForPlayer(shop, playerid);
    TogglePlayerControllable(playerid,0);
    }
    return 1;
    }


    Rest:
    public OnPlayerSelectedMenuRow(playerid, row)
    {
    if(GetPlayerMenu(playerid) == shop)
    {
    switch(row)
    {
    case 0:
    {
    GivePlayerMoney(playerid,-2);
    SetPVarInt(playerid,"Beer",1);
    TogglePlayerControllable(playerid,1);
    SendClientMessage(playerid,COLOR_CMD,"You have bought a beer for $2.");
    }
    case 1:
    {
    GivePlayerMoney(playerid,-2);
    SetPVarInt(playerid,"Sprunk",1);
    TogglePlayerControllable(playerid,1);
    SendClientMessage(playerid,COLOR_CMD,"You have bought a beer for $2.");
    }
    case 2:
    {
    GivePlayerMoney(playerid,-3);
    SetPVarInt(playerid,"40z",1);
    TogglePlayerControllable(playerid,1);
    SendClientMessage(playerid,COLOR_CMD,"You have bought a beer for $2.");
    }
    case 3:
    {
    GivePlayerMoney(playerid,-5);
    SetPVarInt(playerid,"Ciga",1);
    TogglePlayerControllable(playerid,1);
    SendClientMessage(playerid,COLOR_CMD,"You have bought a beer for $2.");
    }
    case 4:
    {
    GivePlayerMoney(playerid,-10);
    SetPVarInt(playerid,"Spraycan",1);
    TogglePlayerControllable(playerid,1);
    SendClientMessage(playerid,COLOR_CMD,"You have bought a beer for $2.");
    }
    case 5:
    {
    GivePlayerMoney(playerid,-145);
    SetPVarInt(playerid,"Phone",1);
    TogglePlayerControllable(playerid,1);
    SendClientMessage(playerid,COLOR_CMD,"You have bought a beer for $2.");
    }
    case 6:
    {
    GivePlayerMoney(playerid,-100);
    SetPVarInt(playerid,"Lottery Ticket",1);
    TogglePlayerControllable(playerid,1);
    SendClientMessage(playerid,COLOR_CMD,"You have bought a beer for $2.");
    }
    case 7:
    {
    GivePlayerMoney(playerid,-65);
    GivePlayerWeapon(playerid,5,1);
    TogglePlayerControllable(playerid,1);
    SendClientMessage(playerid,COLOR_CMD,"You have bought a beer for $2.");
    }
    case 8: TogglePlayerControllable(playerid,1);
    }
    }
    return 1;
    }


    public OnPlayerExitedMenu(playerid)
    {
    TogglePlayerControllable(playerid,1);
    SendClientMessage(playerid,COLOR_CMD,"Cashier: Goodbye! Have a nice day.");
    return 1;
    }


    Wäre dankbar wenn mir jemand helfen könnte :thumbup:

    Du brauchst Hilfe beim scripten? Siehe Hier:


    Klick mich!


    Derzeitiges Projekt: Youngs Deathmatch 1.0.0 [||||||||||]