/supcar nur eins

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
  • Kleine Frage möchte das man nur ein Car Spawnen kann wenn man es gelöscht hat kann man wieder nur eins Spawnen. Aktuell kann man unbegrenzt Fahrzeuge Spawnen.


    Ich hoffe das reicht..


    if(strcmp(cmd, "/supcar", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (PlayerInfo[playerid][pAdmin] >= 1||PlayerInfo[playerid][pSupporter] >= 1)
    {
    ShowPlayerDialog(playerid,DIALOG_SUPCAR, DIALOG_STYLE_LIST,"{FFFFFF}Sup Cars Auswahl","Rancher\nSultan\nNRG-500\nMaverick\nSandking\nDune","Auswählen", "Abbrechen");
    }
    }
    }



    if(dialogid == DIALOG_SUPCAR)
    {
    if(response)
    {
    if(listitem == 0)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(505, X,Y,Z, 194.1, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    if(listitem == 1)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(560, X,Y,Z, 194.1, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    if(listitem == 2)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(522, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    if(listitem == 3)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(487, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    if(listitem == 4)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(495, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    if(listitem == 5)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(573, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    }
    }

  • if(dialogid == DIALOG_SUPCAR)
    {
    if(SupCar[playerid])DestroyVehicle(SupCar[playerid]);
    {
    if(response)
    {
    if(listitem == 0)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(505, X,Y,Z, 194.1, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    if(listitem == 1)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(560, X,Y,Z, 194.1, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    if(listitem == 2)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(522, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    if(listitem == 3)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(487, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    if(listitem == 4)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(495, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    if(listitem == 5)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(573, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
    SetVehicleToRespawn(sup_car);
    PutPlayerInVehicle(playerid,sup_car,0);
    }
    }
    }
    }




    Habe es Ober eingefügt und alles überschrieben und die if abfrage reingehauen


    bekomme aber Errors


    D:\Daten von Luca\Desktop\Luca\RealLife\gamemodes\NSR.pwn(52465) : warning 219: local variable "SupCar" shadows a variable at a preceding level
    D:\Daten von Luca\Desktop\Luca\RealLife\gamemodes\NSR.pwn(52465) : error 008: must be a constant expression; assumed zero
    D:\Daten von Luca\Desktop\Luca\RealLife\gamemodes\NSR.pwn(52465) : error 008: must be a constant expression; assumed zero
    D:\Daten von Luca\Desktop\Luca\RealLife\gamemodes\NSR.pwn(52465) : error 036: empty statement
    D:\Daten von Luca\Desktop\Luca\RealLife\gamemodes\NSR.pwn(52465) : 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.

  • Du kannst auch einfach eine Spielervariable erstellen und den Wert auf 1 setzen.
    Beim Befehl dann abfragen ob der Wert 1 oder 0 ist.
    Wenn er schon 1 ist dann soll eine Fehlermeldung kommen.
    Hoffe ich habe dich richtig verstanden ...

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • if(strcmp(cmd, "/supcar", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (SupCar[playerid])DestroyVehicle(SupCar[playerid]);
    {
    if (PlayerInfo[playerid][pAdmin] >= 1||PlayerInfo[playerid][pSupporter] >= 1)
    {
    ShowPlayerDialog(playerid,DIALOG_SUPCAR, DIALOG_STYLE_LIST,"{FFFFFF}Sup Cars Auswahl","Rancher\nSultan\nNRG-500\nMaverick\nSandking\nDune","Auswählen", "Abbrechen");
    }
    }
    }


    if(dialogid == DIALOG_SUPCAR)
    {
    if(response)
    {
    if(listitem == 0)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(505, X,Y,Z, 194.1, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    if(listitem == 1)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(560, X,Y,Z, 194.1, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    if(listitem == 2)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(522, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    if(listitem == 3)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(487, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    if(listitem == 4)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(495, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    if(listitem == 5)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new sup_car = CreateVehicle(573, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    }
    }


    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\pawno\include\M_Bot.inc(164) : error 017: undefined symbol "IsAnAdmin"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(3381) : error 017: undefined symbol "IsPlayerInFrac"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(3391) : error 017: undefined symbol "IsPlayerInFrac"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(3401) : error 017: undefined symbol "IsPlayerInFrac"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(3419) : error 017: undefined symbol "IsAFahrschulVeh"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(3432) : error 017: undefined symbol "IsPlayerInFrac"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(3442) : error 017: undefined symbol "IsPlayerInFrac"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(3452) : error 017: undefined symbol "IsPlayerInFrac"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(4000) : error 017: undefined symbol "GetZoneColorOfFaction"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(4109) : error 017: undefined symbol "OnPlayerCarLogin"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(4772) : error 017: undefined symbol "GetPlayerFaction"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(4784) : error 017: undefined symbol "GetPlayerFaction"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(4824) : error 017: undefined symbol "RemoveBlitzer"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(4839) : error 017: undefined symbol "OnPlayerCarUpdate"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5020) : error 017: undefined symbol "IsPlayerInFrac"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5033) : error 017: undefined symbol "RemoveRoadblock"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5045) : error 017: undefined symbol "IsPlayerInFrac"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5118) : error 017: undefined symbol "SetPlayerToKnast"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5430) : error 017: undefined symbol "IsPlayerInFrac"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5793) : error 004: function "ClearBlack" is not implemented
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5798) : error 017: undefined symbol "IsAFightFaction"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5800) : error 017: undefined symbol "GetPlayerFightzone"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5805) : error 017: undefined symbol "GetPlayerFaction"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5807) : error 017: undefined symbol "IsAFightFaction"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5810) : error 017: undefined symbol "GetPlayerFaction"
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(5818) : error 017: undefined symbol "GetFactionNameOfFaction"


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



    26 Errors.


  • 26 errors... Klammerfehler 8o

    Desinteresse ist die größte Provokation.

  • Klammer Fehler behoben jetzt kommt noch das:


    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(51719) : warning 219: local variable "SupCar" shadows a variable at a preceding level
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(51719) : error 008: must be a constant expression; assumed zero
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(51719) : error 008: must be a constant expression; assumed zero
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(51719) : error 036: empty statement
    D:\Daten von Luca\Desktop\Luca\NeoN SkyLine RealLife\gamemodes\NSR.pwn(51719) : 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.




    if(dialogid == DIALOG_SUPCAR)
    {
    if(response)
    {
    if(listitem == 0)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(505, X,Y,Z, 194.1, 0x050000FF, 0x050000FF, 60000); //Zeile (51719)
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    if(listitem == 1)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(560, X,Y,Z, 194.1, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    if(listitem == 2)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(522, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    if(listitem == 3)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(487, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    if(listitem == 4)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(495, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    if(listitem == 5)
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    new SupCar[playerid] = CreateVehicle(573, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
    SetVehicleNumberPlate (SupCar[playerid], "{0000FF}Admin");
    SetVehicleToRespawn(SupCar[playerid]);
    PutPlayerInVehicle(playerid,SupCar[playerid],0);
    }
    }
    }