ocmd plötzlich Undefined?

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
  • Ein Error schlägt heute denn nächsten und die SuFu mag mich auch nicht mehr :evil:

    C:\Users\Flo\Desktop\Test\gamemodes\dynamicmenusystem.pwn(335) : error 029: invalid expression, assumed zero
    C:\Users\Flo\Desktop\Test\gamemodes\dynamicmenusystem.pwn(335) : error 017: undefined symbol "ocmd_drivein"
    C:\Users\Flo\Desktop\Test\gamemodes\dynamicmenusystem.pwn(335) : error 029: invalid expression, assumed zero
    C:\Users\Flo\Desktop\Test\gamemodes\dynamicmenusystem.pwn(335) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.


    Diese Errors treten ja normalerweise auf wenn man ocmd nicht Includiert hat oder es unter einen Public schreibt habe ich aber beides nicht 8|


    Hier mal mein ganzer Code:

    // ~~~~~~~~~~~ Copy Right ~~~~~~~~~~ //
    /*
    Du darfst:
    - Das Script benutzen
    - Das Script Editieren


    Du darfst nicht:
    - Das Script veröffentlichen
    - Das Script publiziern
    - Das Script verkaufen
    - Das Script als deines Ausgeben


    Das Script Wurde von HellYeah Geschrieben,
    User Profil auf BreadFish: http://forum.sa-mp.de/index.php?page=User&userID=28434
    */
    // ~~~~~~~ Copy Right Ende ~~~~~~~~ //


    #define FILTERSCRIPT


    #include <a_samp>
    #include <dini>
    #include <ocmd>
    #include <a_players>


    #define MAX_DRIVEIN 5 // Einstellbar


    enum drivein_info
    {
    Float:drivein_x,
    Float:drivein_y,
    Float:drivein_z,
    Text3D:drivein_label
    }
    new DriveinInfo[MAX_DRIVEIN][drivein_info];


    #define MAX_MENU 5 // Einstellbar


    enum menu_info
    {
    Float:menu_x,
    Float:menu_y,
    Float:menu_z,
    Text3D:menu_label
    }
    new MenuInfo[MAX_MENU][menu_info];


    #pragma tabsize 0
    #pragma unused ret_memcpy


    #define DIALOG_DRIVEIN 25111 // Wer will kann die DialogID ändern :>
    #define BLAU 0x0087FFFF
    #define ROT 0xE10000FF
    // BSN Menu //
    new Menu:menupunkteladen;
    new Menu:getraenke;
    new Menu:fastfood;
    new Menu:suessigkeiten;
    // BSN Ende //



    #if defined FILTERSCRIPT



    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" DriveIn&Menu System by HellYeah Loaded!");
    print("--------------------------------------\n");

    // bsnenterpickup = CreatePickup(1318,1,1199.2806,-918.1400,43.1231,0);
    // bsnexitpickup = CreatePickup(1318,1,362.9400,-75.2381,1001.5078,0);

    Create3DTextLabel("Benutze /drivein um etwas zu Essen zu kaufen!",BLAU,1206.5031,-885.2070,42.9292,0,0);
    // BSN Snacks //
    menupunkteladen = CreateMenu("Shop",2, 200.0, 150.0, 120.0, 50.0);
    AddMenuItem(menupunkteladen,0, "Getraenke");
    AddMenuItem(menupunkteladen,0, "Fastfood");
    AddMenuItem(menupunkteladen,0, "Sueßigkeiten");


    getraenke = CreateMenu("Getraenke",2, 200.0, 150.0, 120.0, 50.0);
    AddMenuItem(getraenke,0, "Cola[99$]");
    AddMenuItem(getraenke,0, "Fanta[25$]");
    AddMenuItem(getraenke,0, "Sprite[17$]");
    AddMenuItem(getraenke,0, "Sprudel[47$]");
    AddMenuItem(getraenke,0, "Stilles Wasser[32$]");


    fastfood = CreateMenu("Fastfood",2, 200.0, 150.0, 120.0, 50.0);
    AddMenuItem(fastfood,0, "Bigmac[127$]");
    AddMenuItem(fastfood,0, "Chesseburger[200$]");
    AddMenuItem(fastfood,0, "Hamburger[47$]");
    AddMenuItem(fastfood,0, "Döner Pizza[99$]");


    suessigkeiten = CreateMenu("Sueßigkeiten",2, 200.0, 150.0, 120.0, 50.0);
    AddMenuItem(suessigkeiten,0, "Chips[99$]");
    AddMenuItem(suessigkeiten,0, "Mentos[59$]");
    AddMenuItem(suessigkeiten,0, "Schokolade[150$]");
    AddMenuItem(suessigkeiten,0, "Gummibaerchen[200$]");
    Create3DTextLabel("Benutze /menu um dir etwas zu Essen zu kaufen!",BLAU,377.2999,-67.4349,1001.5078,30,0,0);
    // BSN Menü ENDE :< //


    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    }


    #endif


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    // BSN //
    /*
    if(pickupid==bsnenterpickup)
    {
    SetPlayerPos(playerid,364.5561,-74.2316,1001.5078);
    SetPlayerInterior(playerid,10);
    }


    if(pickupid==bsnexitpickup)
    {
    SetPlayerPos(playerid,1199.4159,-920.4664,43.1096);
    SetPlayerInterior(playerid,0);
    }
    */
    // BSN ENDE //
    return 1;
    }


    // BSN Drivein Ende //


    public OnPlayerSelectedMenuRow(playerid, row)
    {
    new Menu:CurrentMenu = GetPlayerMenu(playerid);


    if(CurrentMenu == menupunkteladen)
    {
    switch(row)
    {
    case 0:
    {
    ShowMenuForPlayer(getraenke,playerid);
    }
    case 1:
    {
    ShowMenuForPlayer(fastfood,playerid);
    }
    case 2:
    {
    ShowMenuForPlayer(suessigkeiten,playerid);
    }
    }
    }


    if(CurrentMenu == getraenke)
    {
    switch(row)
    {
    case 0:
    {
    GameTextForPlayer(playerid,"Cola gekauft! (KostenPunkt: 99$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-99);
    }
    case 1:
    {
    GameTextForPlayer(playerid,"Fanta gekauft! (KostenPunkt: 25$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-25);
    }
    case 2:
    {
    GameTextForPlayer(playerid,"Sprite gekauft! (KostenPunkt: 17$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-17);
    }
    case 3:
    {
    GameTextForPlayer(playerid,"Sprudel gekauft! (KostenPunkt: 49$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-49);
    }
    case 4:
    {
    GameTextForPlayer(playerid,"Stilles Wasser gekauft! (KostenPunkt: 32$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-32);
    }
    }


    if(CurrentMenu == fastfood)
    {
    switch(row)
    {
    case 0:
    {
    GameTextForPlayer(playerid,"Bigmac gekauft! (KostenPunkt: 127$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-127);
    }
    case 1:
    {
    GameTextForPlayer(playerid,"Chesseburger gekauft! (KostenPunkt: 200$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-200);
    }
    case 2:
    {
    GameTextForPlayer(playerid,"Hamburger gekauft! (KostenPunkt: 47$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-47);
    }
    case 3:
    {
    GameTextForPlayer(playerid,"Döner Pizza gekauft! (KostenPunkt: 99$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-99);
    }
    }
    }


    if(CurrentMenu == suessigkeiten)
    switch(row)
    {
    case 0:
    {
    GameTextForPlayer(playerid,"Chips gekauft! (KostenPunkt: 99$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-99);
    }
    case 1:
    {
    GameTextForPlayer(playerid,"Mentos gekauft!(KostenPunkt: 59$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-59);
    }
    case 2:
    {
    GameTextForPlayer(playerid,"Schokolade gekauft! (KostenPunkt: 150$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-150);
    }
    case 3:
    {
    GameTextForPlayer(playerid,"Gummibaerchen gekauft!(KostenPunkt: 200$)",3000,3);
    SetPlayerHealth(playerid,100.00);
    GivePlayerMoney(playerid,-200);
    }
    }
    }
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    new Float:health2;
    if(dialogid == DIALOG_DRIVEIN && response)
    {
    switch(listitem)
    {
    case 0:
    {
    GetPlayerHealth(playerid, health2);
    if(health2 < 100) SetPlayerHealth(playerid,GetPlayerHealth(playerid,health2)+50),GameTextForPlayer(playerid,"BigMac Gekauft!",2000,3);
    }
    case 1:
    {
    GetPlayerHealth(playerid, health2);
    if(health2 < 100) SetPlayerHealth(playerid,GetPlayerHealth(playerid,health2)+50),GameTextForPlayer(playerid,"Pommes Gekauft!",2000,3);
    }
    case 2:
    {
    GetPlayerHealth(playerid, health2);
    if(health2 < 100) SetPlayerHealth(playerid,GetPlayerHealth(playerid,health2)+50),GameTextForPlayer(playerid,"BratWurst Gekauft!",2000,3);
    }
    case 3:
    {
    GetPlayerHealth(playerid, health2);
    if(health2 < 100) SetPlayerHealth(playerid,GetPlayerHealth(playerid,health2)+50),GameTextForPlayer(playerid,"Fanta Gekauft!",2000,3);
    }
    case 4:
    {
    GetPlayerHealth(playerid, health2);
    if(health2 < 100) SetPlayerHealth(playerid,GetPlayerHealth(playerid,health2)+50),GameTextForPlayer(playerid,"Coke Gekauft!",2000,3);
    }
    case 5:
    {
    GetPlayerHealth(playerid, health2);
    if(health2 < 100) SetPlayerHealth(playerid,GetPlayerHealth(playerid,health2)+50),GameTextForPlayer(playerid,"Relentess Origin Gekauft!",2000,3);
    }
    }
    }
    }



    // BSN Drivein Stock
    stock AmBSNDrivein(playerid)
    {
    if(IsPlayerInRangeOfPoint(playerid,5,1206.5031,-885.2070,42.9292))
    {
    return 1;
    }
    return 0;
    }


    // BSN Drivein Stock Ende //





    ocmd:menu(playerid,params[])
    {
    for(new menu=1;menu<MAX_MENU;menu++)
    {
    if(IsPlayerInRangeOfPoint(playerid,5,MenuInfo[menu][menu_x],MenuInfo[menu][menu_y],MenuInfo[menu][menu_z]))
    {
    ShowMenuForPlayer(menupunkteladen, playerid);
    }
    else
    {
    SendClientMessage(playerid,ROT,"Du bist bei einem MenüPunkt!");
    }
    return 1;
    }


    // BSN Drivein //
    ocmd:drivein(playerid,params[])
    {
    if(IsPlayerConnected(playerid))
    {
    for(new drivein=1;drivein<MAX_DRIVEIN;drivein++)
    {
    if(IsPlayerInRangeOfPoint(playerid,5,DriveinInfo[drivein][drivein_x],DriveinInfo[drivein][drivein_y],DriveinInfo[drivein][drivein_z]))
    {
    if(!IsPlayerInAnyVehicle(playerid))
    {
    SendClientMessage(playerid, ROT, "Du musst in einem Fahrzeug sein!");
    return 1;
    }


    ShowPlayerDialog(playerid,DIALOG_DRIVEIN,DIALOG_STYLE_LIST,"DriveIn","BigMac[59$]\nPommes[23$]\nBratwurst[124$]\nFanta[13$]\nCola[19$]\nEnergy Drink[72$]","Auswählen","Abbrechen");
    }
    else
    {
    SendClientMessage(playerid, ROT, "Du bist nicht beim BSN");
    return 1;
    }
    }
    return 1;
    }


    Habe gerade auch ocmd Aktualisiert && Pawno Neugestartet hilft nicht *g*


  • /*
    OCMD 2.0.2
    by Kleiner Opa
    best command-solution for sa:mp
    supports samp 0.2X, 0.3a, 0.3b, 0.3c, 0.3d, 0.3e, 0.3x
    email: fisch70000@gmail.com
    http://forum.sa-mp.de/index.php?page=User&userID=24998
    */


    #include <a_samp>


    forward ocmdOnPlayerCommandText(playerid,cmdtext[]);
    #if defined OCMD_BEFORE_CALLBACK
    forward BeforePlayerCommandText(playerid,cmdtext[]);
    new bool:ocmdBeforeCallback,bool:ocmdInit;
    #endif


    #define ocmd:%1(%2) forward ocmd_%1(%2);\
    public ocmd_%1(%2)


    public OnPlayerCommandText(playerid,cmdtext[])
    {
    #if defined OCMD_BEFORE_CALLBACK
    if(!ocmdInit)
    {
    if(funcidx("BeforePlayerCommandText")!=-1)ocmdBeforeCallback=true;
    ocmdInit=true;
    }
    #endif
    new ocmdStr[32]="ocmd_",
    i=1,
    #if defined OCMD_COMMAND_LOG
    ocmdName[MAX_PLAYER_NAME],
    #endif
    bool:ocmdNoParams;
    #if defined OCMD_COMMAND_LOG
    GetPlayerName(playerid,ocmdName,sizeof ocmdName);
    printf("[cmd] [%s]: %s",ocmdName,cmdtext);
    #endif
    #if defined OCMD_BEFORE_CALLBACK
    if(ocmdBeforeCallback&&!CallLocalFunction("BeforePlayerCommandText","ds",playerid,cmdtext))return 1;
    #endif
    for(;i<128;i++)
    {
    if(!cmdtext[i]||cmdtext[i]==' ')
    {
    if(!cmdtext[i]||!cmdtext[i+1])ocmdNoParams=true;
    break;
    }
    ocmdStr[i+4]=tolower(cmdtext[i]);
    }
    if(!ocmdNoParams&&CallLocalFunction(ocmdStr,"ds",playerid,cmdtext[i+1]))return 1;
    if(ocmdNoParams&&CallLocalFunction(ocmdStr,"ds",playerid," "))return 1;
    return CallLocalFunction("ocmdOnPlayerCommandText","ds",playerid,cmdtext);
    }


    #define OnPlayerCommandText ocmdOnPlayerCommandText

    ...

  • Ich sag nur eins... KLAMMERFEHLER !!!
    ocmd:menu(playerid,params[])
    {
    for(new menu=1;menu<MAX_MENU;menu++)
    {
    if(IsPlayerInRangeOfPoint(playerid,5,MenuInfo[menu][menu_x],MenuInfo[menu][menu_y],MenuInfo[menu][menu_z]))
    {
    ShowMenuForPlayer(menupunkteladen, playerid);
    }
    else
    {
    SendClientMessage(playerid,ROT,"Du bist bei einem MenüPunkt!");
    }
    }
    return 1;
    }


    // BSN Drivein //
    ocmd:drivein(playerid,params[])
    {
    if(IsPlayerConnected(playerid))
    {
    for(new drivein=1;drivein<MAX_DRIVEIN;drivein++)
    {
    if(IsPlayerInRangeOfPoint(playerid,5,DriveinInfo[drivein][drivein_x],DriveinInfo[drivein][drivein_y],DriveinInfo[drivein][drivein_z]))
    {
    if(!IsPlayerInAnyVehicle(playerid))
    {
    SendClientMessage(playerid, ROT, "Du musst in einem Fahrzeug sein!");
    return 1;
    }


    else
    {
    ShowPlayerDialog(playerid,DIALOG_DRIVEIN,DIALOG_STYLE_LIST,"DriveIn","BigMac[59$]\nPommes[23$]\nBratwurst[124$]\nFanta[13$]\nCola[19$]\nEnergy Drink[72$]","Auswählen","Abbrechen");
    }


    }
    else
    {
    SendClientMessage(playerid, ROT, "Du bist nicht beim BSN");
    return 1;
    }
    }
    return 1;
    }
    }