simpler menü fehler den ich net finden kann

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
  • schaut einer pls mal an was falsch is ?


    für die die lieber in pastebin wollen:


    http://pastebin.com/m8ef45a1


    new Menu:exoticexports;




    public OnFilterScriptInit()
    {
    exoticexports = CreateMenu("exoticexports",2,200.0,100.0,150.0,150.0);
    AddMenuItem(exoticexports,0, "Banshee");
    AddMenuItem(exoticexports,1, "Bullet");
    AddMenuItem(exoticexports,2, "Cheetah");
    AddMenuItem(exoticexports,3, "Infernus");
    AddMenuItem(exoticexports,4, "Turismo");
    AddMenuItem(exoticexports,5, "Elegy");
    AddMenuItem(exoticexports,6, "Tornado");
    AddMenuItem(exoticexports,7, "Remington");
    AddMenuItem(exoticexports,8, "Slamvan");
    AddMenuItem(exoticexports,9, "Feltzer");
    AddMenuItem(exoticexports,10, "Stallion");
    AddMenuItem(exoticexports,11, "Mehr");
    return 1;
    }


    if (strcmp("/exotic", cmdtext,true) ==0)
    {
    TogglePlayerControllable(playerid, 1);
    ShowMenuForPlayer(exoticexports,playerid);
    return 1;
    }







    /*----------------------------------------------------------------------------------*/


    public OnPlayerSelectedMenuRow(playerid, row)
    {


    new Menu:CurrentMenu = GetPlayerMenu(playerid);

    if(CurrentMenu == exoticexports)
    {
    switch(row)
    {
    case 0:
    {
    CreateVehicle(429, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Banshee
    }
    case 1:
    {
    CreateVehicle(541, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Bullet
    }
    case 2:
    {
    CreateVehicle(415, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//cheetah
    }
    case 3:
    {
    CreateVehicle(411, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Infernus
    }
    case 4:
    {
    CreateVehicle(451, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Turismo
    }
    case 5:
    {
    CreateVehicle(562,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Elegy
    }
    case 6:
    {
    CreateVehicle(576, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//tornado
    }
    case 7:
    {
    CreateVehicle(534,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Remington
    }
    case 8:
    {
    CreateVehicle(535,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Slamvan
    }
    case 9:
    {
    CreateVehicle(533, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Feltzer
    }
    case 10:
    {
    CreateVehicle(439,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Stallion
    }
    case 11:
    {
    HideMenuForPlayer(playerid, exoticexports);
    }
    }
    return 1;
    }

  • Da is kein cmd dabei z.B: /car und dann kommt das Menü, glaub ich^^


    //Edit: OK die würden dann aber auch in die OnPlayerCommandText gehören!

    Alkohol löst keine Probleme, Milch aber auch nicht! ;)

  • also hab da paar fehler muss cih AddMenuItem erst definieren?


    wenn ja wie?


  • #include <a_samp>
    new Menu:exoticexports;


    public OnFilterScriptInit()
    {
    exoticexports = CreateMenu("exoticexports",2,200.0,100.0,150.0,150.0);
    AddMenuItem(exoticexports,0, "Banshee");
    AddMenuItem(exoticexports,1, "Bullet");
    AddMenuItem(exoticexports,2, "Cheetah");
    AddMenuItem(exoticexports,3, "Infernus");
    AddMenuItem(exoticexports,4, "Turismo");
    AddMenuItem(exoticexports,5, "Elegy");
    AddMenuItem(exoticexports,6, "Tornado");
    AddMenuItem(exoticexports,7, "Remington");
    AddMenuItem(exoticexports,8, "Slamvan");
    AddMenuItem(exoticexports,9, "Feltzer");
    AddMenuItem(exoticexports,10, "Stallion");
    AddMenuItem(exoticexports,11, "Mehr");
    return 1;
    }


    public OnPlayerCommandText(playerid,cmdtext[])
    {
    if (strcmp("/exotic", cmdtext,true) ==0)
    {
    TogglePlayerControllable(playerid, 1);
    ShowMenuForPlayer(exoticexports,playerid);
    return 1;
    }
    return 0;
    }







    /*----------------------------------------------------------------------------------*/


    public OnPlayerSelectedMenuRow(playerid, row)
    {


    new Menu:CurrentMenu = GetPlayerMenu(playerid);


    if(CurrentMenu == exoticexports)
    {
    switch(row)
    {
    case 0:
    {
    CreateVehicle(429, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Banshee
    }
    case 1:
    {
    CreateVehicle(541, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Bullet
    }
    case 2:
    {
    CreateVehicle(415, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//cheetah
    }
    case 3:
    {
    CreateVehicle(411, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Infernus
    }
    case 4:
    {
    CreateVehicle(451, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Turismo
    }
    case 5:
    {
    CreateVehicle(562,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Elegy
    }
    case 6:
    {
    CreateVehicle(576, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//tornado
    }
    case 7:
    {
    CreateVehicle(534,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Remington
    }
    case 8:
    {
    CreateVehicle(535,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Slamvan
    }
    case 9:
    {
    CreateVehicle(533, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Feltzer
    }
    case 10:
    {
    CreateVehicle(439,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Stallion
    }
    case 11:
    {
    HideMenuForPlayer(playerid, exoticexports);
    }
    }
    return 1;
    }

  • ok thx ohne den cmd hab cih noch diese warnings:


    C:\Users\pillepalle\Desktop\Gamemode\Reallife.pwn(535) : warning 213: tag mismatch
    C:\Users\pillepalle\Desktop\Gamemode\Reallife.pwn(535) : warning 213: tag mismatch
    C:\Users\pillepalle\Desktop\Gamemode\Reallife.pwn(540) : warning 209: function "OnPlayerSelectedMenuRow" should return a value
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    Header size: 1928 bytes
    Code size: 24872 bytes
    Data size: 727032 bytes
    Stack/heap size: 16384 bytes; estimated max. usage=4403 cells (17612 bytes)
    Total requirements: 770216 bytes


    3 Warnings.
    wie bekomm cih die weg?

  • public OnPlayerSelectedMenuRow(playerid, row)
    {


    new Menu:CurrentMenu = GetPlayerMenu(playerid);


    if(CurrentMenu == exoticexports)
    {
    switch(row)
    {
    case 0:
    {
    CreateVehicle(429, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Banshee
    }
    case 1:
    {
    CreateVehicle(541, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Bullet
    }
    case 2:
    {
    CreateVehicle(415, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//cheetah
    }
    case 3:
    {
    CreateVehicle(411, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Infernus
    }
    case 4:
    {
    CreateVehicle(451, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Turismo
    }
    case 5:
    {
    CreateVehicle(562,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Elegy
    }
    case 6:
    {
    CreateVehicle(576, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//tornado
    }
    case 7:
    {
    CreateVehicle(534,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Remington
    }
    case 8:
    {
    CreateVehicle(535,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Slamvan
    }
    case 9:
    {
    CreateVehicle(533, -1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Feltzer
    }
    case 10:
    {
    CreateVehicle(439,-1660.8359,1213.9100,7.2500,101.4816, 0, 0, -1);//Stallion
    }
    case 11:
    {
    HideMenuForPlayer(playerid, exoticexports);
    }
    return 1;
    }
    }


    Einfach das return 1zeile nach oben setzen

  • return weglassen dun bei HideMenuForPlayer(playerid, exoticexports)


    HideMenuForPlayer(exoticexports, playerid) machen