|||VehicleSpawner Problem.|||| Bitte um Hilfe!!|||

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
  • Hi leute,
    Was ist hier dran falsch?
    #include <a_samp>


    #define COLOR_BLUE 0xFFFF00AA //ist gelb xD
    new Menu:VehliceMenu;
    new Menu:Vehlice2Menu;


    #if defined FILTERSCRIPT


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Blanko Filterscript by your name here ");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print(" Blanko Filterscript by your name here");
    print("----------------------------------\n");
    }


    #endif


    public OnGameModeInit()
    {
    VehliceMenu = CreateMenu("Vehicle Page 1",10,200,200,400,35);
    AddMenuItem(VehliceMenu, 0, "Tampa");
    AddMenuItem(VehliceMenu, 0, "Hustler");
    AddMenuItem(VehliceMenu, 0, "Remington");
    AddMenuItem(VehliceMenu, 0, "Cheetah");
    AddMenuItem(VehliceMenu, 0, "Infernus");
    AddMenuItem(VehliceMenu, 0, "SuperGT");
    AddMenuItem(VehliceMenu, 0, "Bus");
    AddMenuItem(VehliceMenu, 0, "Baggage");
    AddMenuItem(VehliceMenu, 0, "Dumper");
    AddMenuItem(VehliceMenu, 0, "Next..");


    Vehlice2Menu = CreateMenu("Vehicle Page 2",9,200,200,400,35);
    AddMenuItem(Vehlice2Menu, 0, "Monster");
    AddMenuItem(Vehlice2Menu, 0, "Sandking");
    AddMenuItem(Vehlice2Menu, 0, "NRG500");
    AddMenuItem(Vehlice2Menu, 0, "Faggio");
    AddMenuItem(Vehlice2Menu, 0, "Freeway");
    AddMenuItem(Vehlice2Menu, 0, "Jetmax");
    AddMenuItem(Vehlice2Menu, 0, "Stuntplane");
    AddMenuItem(Vehlice2Menu, 0, "Dodo");
    AddMenuItem(Vehlice2Menu, 0, "Nevada");


    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {


    if (strcmp("/destroy", cmdtext, true, 10) == 0)
    {
    if( IsPlayerAdmin(playerid))
    {
    DestroyVehicle( GetPlayerVehicleID( playerid ) );
    SendClientMessage(playerid, COLOR_BLUE, "Du hast ein Fahrzeug zerstoert.");
    }
    return 1;
    }


    if (strcmp("/v", cmdtext, true) == 0)
    {
    TogglePlayerControllable(playerid, 0);
    ShowMenuForPlayer(VehliceMenu,playerid);
    SendClientMessage(playerid, COLOR_BLUE, "Du hast Cedi´s All Vehicles Menü geöffnet!");
    return 1;
    }


    return 0;
    }


    public OnPlayerSelectedMenuRow(playerid, row)
    {
    TogglePlayerControllable(playerid, 1);
    SetCameraBehindPlayer(playerid);
    new Menu:Current = GetPlayerMenu(playerid);
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerFacingAngle(playerid,a);
    GetPlayerPos(playerid, x, y, z);


    }


    if (Current == VehliceMenu)
    {
    switch(row) {
    case 0: {CreateVehicle(400, x, y, z, a,-1,-1,-1); } //Hustler
    case 1: {CreateVehicle(442, x, y, z, a,-1,-1,-1); } //Tampa
    case 2: {CreateVehicle(534, x, y, z, a,-1,-1,-1); } //Remington
    case 3: {CreateVehicle(415, x, y, z, a,-1,-1,-1); } //Cheetah
    case 4: {CreateVehicle(411, x, y, z, a,-1,-1,-1); } //Infernus
    case 5: {CreateVehicle(506, x, y, z, a,-1,-1,-1); } //SuperGT
    case 6: {CreateVehicle(431, x, y, z, a,-1,-1,-1); } //Bus
    case 7: {CreateVehicle(485, x, y, z, a,-1,-1,-1); } //Baggage
    case 8: {CreateVehicle(406, x, y, z, a,-1,-1,-1); } //Dumper
    case 9: {ShowMenuForPlayer(Vehlice2Menu, playerid); TogglePlayerControllable(playerid, 0);}
    }}


    if (Current == VehliceMenu2)
    {
    switch(row) {
    case 0: {CreateVehicle(483, x, y, z, a,-1,-1,-1); } //Monster
    case 1: {CreateVehicle(495, x, y, z, a,-1,-1,-1); } //Sanking
    case 2: {CreateVehicle(522, x, y, z, a,-1,-1,-1); } //NRG 500
    case 3: {CreateVehicle(462, x, y, z, a,-1,-1,-1); } //Faggio
    case 4: {CreateVehicle(463, x, y, z, a,-1,-1,-1); } //Freeway
    case 5: {CreateVehicle(473, x, y, z, a,-1,-1,-1); } //jetmax
    case 6: {CreateVehicle(593, x, y, z, a,-1,-1,-1); } //dodo
    case 7: {CreateVehicle(513, x, y, z, a,-1,-1,-1); } //stuntplane
    case 8: {CreateVehicle(553, x, y, z, a,-1,-1,-1); } //nevada
    }}






    return 1;
    }


    public OnPlayerExitedMenu(playerid)
    {
    new Menu:Current = GetPlayerMenu(playerid);
    if (Current == VehliceMenu || VehliceMenu2)
    {
    TogglePlayerControllable(playerid, 0);
    ShowMenuForPlayer(VehliceMenu, playerid);
    }


    else {
    TogglePlayerControllable(playerid, 0);
    }


    return 1;
    }


    Erorrs:
    D:\Vehiclespawner.pwn(89) : warning 204: symbol is assigned a value that is never used: "Current"
    D:\Vehiclespawner.pwn(89 -- 96) : error 010: invalid function or declaration
    D:\Vehiclespawner.pwn(89 -- 98) : error 010: invalid function or declaration
    D:\Vehiclespawner.pwn(89 -- 99) : error 010: invalid function or declaration
    D:\Vehiclespawner.pwn(89 -- 99) : 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.


    Schonmal danke für eure antworten.
    MFG,Cedi :thumbup:


  • #include <a_samp>


    #define COLOR_BLUE 0xFFFF00AA //ist gelb xD
    new Menu:VehliceMenu;
    new Menu:Vehlice2Menu;


    #if defined FILTERSCRIPT


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Blanko Filterscript by your name here ");
    print("--------------------------------------\n");


    VehliceMenu = CreateMenu("Vehicle Page 1",10,200,200,400,35);
    AddMenuItem(VehliceMenu, 0, "Tampa");
    AddMenuItem(VehliceMenu, 0, "Hustler");
    AddMenuItem(VehliceMenu, 0, "Remington");
    AddMenuItem(VehliceMenu, 0, "Cheetah");
    AddMenuItem(VehliceMenu, 0, "Infernus");
    AddMenuItem(VehliceMenu, 0, "SuperGT");
    AddMenuItem(VehliceMenu, 0, "Bus");
    AddMenuItem(VehliceMenu, 0, "Baggage");
    AddMenuItem(VehliceMenu, 0, "Dumper");
    AddMenuItem(VehliceMenu, 0, "Next..");


    Vehlice2Menu = CreateMenu("Vehicle Page 2",9,200,200,400,35);
    AddMenuItem(Vehlice2Menu, 0, "Monster");
    AddMenuItem(Vehlice2Menu, 0, "Sandking");
    AddMenuItem(Vehlice2Menu, 0, "NRG500");
    AddMenuItem(Vehlice2Menu, 0, "Faggio");
    AddMenuItem(Vehlice2Menu, 0, "Freeway");
    AddMenuItem(Vehlice2Menu, 0, "Jetmax");
    AddMenuItem(Vehlice2Menu, 0, "Stuntplane");
    AddMenuItem(Vehlice2Menu, 0, "Dodo");
    AddMenuItem(Vehlice2Menu, 0, "Nevada");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    main()
    {
    print("\n----------------------------------");
    print(" Blanko Filterscript by your name here");
    print("----------------------------------\n");
    }


    #endif


    public OnPlayerCommandText(playerid, cmdtext[])
    {


    if (strcmp("/destroy", cmdtext, true, 10) == 0)
    {
    if( IsPlayerAdmin(playerid))
    {
    DestroyVehicle( GetPlayerVehicleID( playerid ) );
    SendClientMessage(playerid, COLOR_BLUE, "Du hast ein Fahrzeug zerstoert.");
    }
    return 1;
    }


    if (strcmp("/v", cmdtext, true) == 0)
    {
    TogglePlayerControllable(playerid, 0);
    ShowMenuForPlayer(VehliceMenu,playerid);
    SendClientMessage(playerid, COLOR_BLUE, "Du hast Cedi´s All Vehicles Menü geöffnet!");
    return 1;
    }


    return 0;
    }


    public OnPlayerSelectedMenuRow(playerid, row)
    {
    TogglePlayerControllable(playerid, 1);
    SetCameraBehindPlayer(playerid);
    new Menu:Current = GetPlayerMenu(playerid);
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerFacingAngle(playerid,a);
    GetPlayerPos(playerid, x, y, z);


    if (Current == VehliceMenu)
    {
    switch(row)
    {
    case 0: {CreateVehicle(400, x, y, z, a,-1,-1,-1); } //Hustler
    case 1: {CreateVehicle(442, x, y, z, a,-1,-1,-1); } //Tampa
    case 2: {CreateVehicle(534, x, y, z, a,-1,-1,-1); } //Remington
    case 3: {CreateVehicle(415, x, y, z, a,-1,-1,-1); } //Cheetah
    case 4: {CreateVehicle(411, x, y, z, a,-1,-1,-1); } //Infernus
    case 5: {CreateVehicle(506, x, y, z, a,-1,-1,-1); } //SuperGT
    case 6: {CreateVehicle(431, x, y, z, a,-1,-1,-1); } //Bus
    case 7: {CreateVehicle(485, x, y, z, a,-1,-1,-1); } //Baggage
    case 8: {CreateVehicle(406, x, y, z, a,-1,-1,-1); } //Dumper
    case 9: {ShowMenuForPlayer(Vehlice2Menu, playerid); TogglePlayerControllable(playerid, 0);
    }}


    if (Current == Vehlice2Menu)
    {
    switch(row)
    {
    case 0: {CreateVehicle(483, x, y, z, a,-1,-1,-1); } //Monster
    case 1: {CreateVehicle(495, x, y, z, a,-1,-1,-1); } //Sanking
    case 2: {CreateVehicle(522, x, y, z, a,-1,-1,-1); } //NRG 500
    case 3: {CreateVehicle(462, x, y, z, a,-1,-1,-1); } //Faggio
    case 4: {CreateVehicle(463, x, y, z, a,-1,-1,-1); } //Freeway
    case 5: {CreateVehicle(473, x, y, z, a,-1,-1,-1); } //jetmax
    case 6: {CreateVehicle(593, x, y, z, a,-1,-1,-1); } //dodo
    case 7: {CreateVehicle(513, x, y, z, a,-1,-1,-1); } //stuntplane
    case 8: {CreateVehicle(553, x, y, z, a,-1,-1,-1); } //nevada
    }}
    return 1;
    }


    public OnPlayerExitedMenu(playerid)
    {
    new Menu:Current = GetPlayerMenu(playerid);
    if (Current == VehliceMenu || Vehlice2Menu)
    {
    TogglePlayerControllable(playerid, 0);
    ShowMenuForPlayer(VehliceMenu, playerid);
    }
    else
    {
    TogglePlayerControllable(playerid, 0);
    }
    return 1;
    }


    probier ma so


    Zitat

    omg lern einrücken :D hier hab mal alles eingerückt,was war falsch:
    2 mal hast du vehiclemenu2 geschrieben obwohl du es mit vehicle2menu dekladiert hast und du hast bei selectmenu row durch die erste } klammer die funktion vorzeitig gegkürzt...


    Hab ich auch gesehen, aber er hat oben die Vehicles in OnGameModeInit gemacht, das muss in OnFilterScriptInit, da es ein FS ist

  • probier ma so



    C:\Users\Benjamin\Desktop\cedi.pwn(103) : error 017: undefined symbol "VehliceMenu2"
    C:\Users\Benjamin\Desktop\cedi.pwn(120) : error 029: invalid expression, assumed zero
    C:\Users\Benjamin\Desktop\cedi.pwn(120) : error 004: function "OnPlayerExitedMenu" is not implemented
    C:\Users\Benjamin\Desktop\cedi.pwn(122) : warning 219: local variable "Current" shadows a variable at a preceding level
    C:\Users\Benjamin\Desktop\cedi.pwn(123) : error 017: undefined symbol "VehliceMenu2"
    C:\Users\Benjamin\Desktop\cedi.pwn(134) : error 030: compound statement not closed at the end of file (started at line 80)
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    5 Errors.
    Fail ;) Wenn dus nichtmal Testest warum postest du dann ne antwort? 8|