Problem mit Blaulicht

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
  • Guten morgen..
    ich wollte mir ein blaulicht auf meim car scripten aber es geht nicht :( schade es kommen aber auch keine errors vill könntet ihr ja mal reinschauen hir der script:
    // This is a comment
    // uncomment the line below if you want to write a filterscript
    //#define FILTERSCRIPT




    #include <a_samp>
    new sirene[MAX_VEHICLES];
    new sirene1[MAX_VEHICLES];
    new sirene2[MAX_VEHICLES];
    new sirene3[MAX_VEHICLES];
    new UCL[MAX_VEHICLES];


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Blaulicht");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    public OnVehicleSpawn(vehicleid)
    {
    DestroyObject(sirene[vehicleid]);
    DestroyObject(sirene1[vehicleid]);
    DestroyObject(sirene2[vehicleid]);
    DestroyObject(sirene3[vehicleid]);
    UCL[vehicleid] = 0;
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext, "/blaulicht",true) == 0)
    {
    if(UCL[GetPlayerVehicleID(playerid)] == 1)
    {
    sirene[GetPlayerVehicleID(playerid)] = CreateObject(19288,0,0,0,0,0,0,100);
    sirene1[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,0,0,0,0,100);
    sirene2[GetPlayerVehicleID(playerid)] = CreateObject(19288,0,0,0,0,0,0,100);
    sirene3[GetPlayerVehicleID(playerid)] = CreateObject(19288,0,0,0,0,0,0,100);
    AttachObjectToVehicle(sirene[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0 ,2.6,0,0,0,0);//Vorne Mitte
    AttachObjectToVehicle(sirene1[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.5,0.0,0.85,0,0,0);//Dach sirene
    AttachObjectToVehicle(sirene2[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0.7,2.6,0,0,0,0);//Vorne Licht Beifahrerseite
    AttachObjectToVehicle(sirene3[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.7,2.6,0,0,0,0);//Vorne Licht Fahrerseite
    UCL[GetPlayerVehicleID(playerid)] = 1;
    return 1;
    }
    else if(UCL[GetPlayerVehicleID(playerid)] == 573)
    {
    DestroyObject(sirene[GetPlayerVehicleID(playerid)]);
    DestroyObject(sirene1[GetPlayerVehicleID(playerid)]);
    DestroyObject(sirene2[GetPlayerVehicleID(playerid)]);
    DestroyObject(sirene3[GetPlayerVehicleID(playerid)]);
    UCL[GetPlayerVehicleID(playerid)] = 0;
    return 1;
    }
    }
    return 0;
    }


    Und ich habe KEINE errors!

  • Probier das Mal:


    // This is a comment
    // uncomment the line below if you want to write a filterscript
    #define FILTERSCRIPT


    #include <a_samp>


    new sirene[MAX_VEHICLES];
    new sirene1[MAX_VEHICLES];
    new sirene2[MAX_VEHICLES];
    new sirene3[MAX_VEHICLES];
    new UCL[MAX_VEHICLES];


    #if defined FILTERSCRIPT


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Blaulicht");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
    }


    #endif


    public OnVehicleSpawn(vehicleid)
    {
    DestroyObject(sirene[vehicleid]);
    DestroyObject(sirene1[vehicleid]);
    DestroyObject(sirene2[vehicleid]);
    DestroyObject(sirene3[vehicleid]);
    UCL[vehicleid] = 0;
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext, "/blaulicht",true) == 0)
    {
    if(UCL[GetPlayerVehicleID(playerid)] == 1)
    {
    sirene[GetPlayerVehicleID(playerid)] = CreateObject(19288,0,0,0,0,0,0,100);
    sirene1[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,0,0,0,0,100);
    sirene2[GetPlayerVehicleID(playerid)] = CreateObject(19288,0,0,0,0,0,0,100);
    sirene3[GetPlayerVehicleID(playerid)] = CreateObject(19288,0,0,0,0,0,0,100);
    AttachObjectToVehicle(sirene[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0 ,2.6,0,0,0,0);//Vorne Mitte
    AttachObjectToVehicle(sirene1[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.5,0.0,0.85,0,0,0);//Dach sirene
    AttachObjectToVehicle(sirene2[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0.7,2.6,0,0,0,0);//Vorne Licht Beifahrerseite
    AttachObjectToVehicle(sirene3[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.7,2.6,0,0,0,0);//Vorne Licht Fahrerseite
    UCL[GetPlayerVehicleID(playerid)] = 1;
    return 1;
    }
    else if(UCL[GetPlayerVehicleID(playerid)] == 573)
    {
    DestroyObject(sirene[GetPlayerVehicleID(playerid)]);
    DestroyObject(sirene1[GetPlayerVehicleID(playerid)]);
    DestroyObject(sirene2[GetPlayerVehicleID(playerid)]);
    DestroyObject(sirene3[GetPlayerVehicleID(playerid)]);
    UCL[GetPlayerVehicleID(playerid)] = 0;
    return 1;
    }
    }
    return 0;
    }


    Jetzt speicherst du die Datei ab.
    Verschiebst sie in das Verzeichnis "Filterscripts".
    Öffne die Datei server.cfg.
    Suche die Linie "filterscript".
    Kopier das rein:
    filterscripts DER_NAME_DEINES_FILTERSCRIPTS


  • public OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext, "/blaulicht",true) == 0)
    {
    if(UCL[GetPlayerVehicleID(playerid)] == 0)
    {
    sirene[GetPlayerVehicleID(playerid)] = CreateObject(19288,0,0,0,0,0,0,100);
    sirene1[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,0,0,0,0,100);
    sirene2[GetPlayerVehicleID(playerid)] = CreateObject(19288,0,0,0,0,0,0,100);
    sirene3[GetPlayerVehicleID(playerid)] = CreateObject(19288,0,0,0,0,0,0,100);
    AttachObjectToVehicle(sirene[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0 ,2.6,0,0,0,0);//Vorne Mitte
    AttachObjectToVehicle(sirene1[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.5,0.0,0.85,0,0,0);//Dach sirene
    AttachObjectToVehicle(sirene2[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0.7,2.6,0,0,0,0);//Vorne Licht Beifahrerseite
    AttachObjectToVehicle(sirene3[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.7,2.6,0,0,0,0);//Vorne Licht Fahrerseite
    UCL[GetPlayerVehicleID(playerid)] = 1;
    return 1;
    }
    else if(UCL[GetPlayerVehicleID(playerid)] == 1)
    {
    DestroyObject(sirene[GetPlayerVehicleID(playerid)]);
    DestroyObject(sirene1[GetPlayerVehicleID(playerid)]);
    DestroyObject(sirene2[GetPlayerVehicleID(playerid)]);
    DestroyObject(sirene3[GetPlayerVehicleID(playerid)]);
    UCL[GetPlayerVehicleID(playerid)] = 0;
    return 1;
    }
    }
    return 0;
    }


    probier es mal so