Hilfe bei einem newstatekey

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

  • if(newkeys & KEY_CROUCH)
    {
    if(IsACop(playerid))
    {
    IsPlayerInAnyVehicle(playerid);
    {
    new vid = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(vid == 560 || vid == 415 || vid == 451 || vid == 458 || vid == 528 || vid == 541 || vid == 405 || vid == 551 || vid == 482 || vid == 437 || vid == 602 || vid == 470 || vid == 433)
    {
    sfl1[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,-1000,0,0,0,100);
    sfl2[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,-1000,0,0,0,100);
    sfl3[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,-1000,0,0,0,100);
    sfl4[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,-1000,0,0,0,100);
    sfl5[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,-1000,0,0,0,100);
    if(vid == 560)
    {
    // AttachObjectToVehicle(sfl1[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.365000,2.250000,0.049999,0.000000,0.000000,0.000000);
    // AttachObjectToVehicle(sfl2[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0.405000,2.250000,0.049999,0.000000,0.000000,0.000000);
    // AttachObjectToVehicle(sfl3[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0.270000,2.275000,0.019999,0.000000,0.000000,0.000000);
    // AttachObjectToVehicle(sfl4[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.304999,2.275000,0.019999,0.000000,0.000000,0.000000);
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,0.869999,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 415)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.40,-0.035,0.62,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 405)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,0.79,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 502)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.40,-0.035,0.62,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 458)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,0.75,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 482)
    {
    //das 0.04999 ist hier die höhe
    AttachObjectToVehicle(sfl1[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.365000,2.250000,0.0399,0.000000,0.000000,0.000000);
    AttachObjectToVehicle(sfl2[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0.405000,2.250000,0.0399,0.000000,0.000000,0.000000);
    AttachObjectToVehicle(sfl3[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0.270000,2.275000,0.009,0.000000,0.000000,0.000000);
    AttachObjectToVehicle(sfl4[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.304999,2.275000,0.009,0.000000,0.000000,0.000000);
    //AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,0.75,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 528)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,1.10,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 541)
    {
    //das 0.04999 ist hier die höhe
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.40,-0.069999,0.68,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 551)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.40,-0.069999,1.0,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 433)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,1.500000,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 470)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,1.15,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 602)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,0.77,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 437)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,2.0,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 451)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.40,-0.35,0.63,0.000000,0.000000,0.000000);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,0xFFFFFFFF,"An dieses Fahrzeug kannst du keine Sirene montieren!");
    }
    }
    }
    }
    }
    if(newkeys & KEY_CROUCH)
    { // Garage Gate Move
    if(IsACop(playerid))
    {
    IsPlayerInAnyVehicle(playerid);
    {
    DestroyObject(sfl1[GetPlayerVehicleID(playerid)]);
    DestroyObject(sfl2[GetPlayerVehicleID(playerid)]);
    DestroyObject(sfl3[GetPlayerVehicleID(playerid)]);
    DestroyObject(sfl4[GetPlayerVehicleID(playerid)]);
    DestroyObject(sfl5[GetPlayerVehicleID(playerid)]);
    }
    }
    return 1;
    }



    Ich will eig das wenn ich "H" drücke das eine Sirene auf dem Fahrzeug erscheint , tut sie zwar aber sie soll auch bei der Taste "H" wieder verschwinden , wie mache ich das ?

  • Geht nicht



    if(newkeys & KEY_CROUCH)
    {
    if(IsACop(playerid))
    {
    new SireneAn=0;
    IsPlayerInAnyVehicle(playerid);
    {
    if(SireneAn==0)
    {
    new vid = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(vid == 560 || vid == 415 || vid == 451 || vid == 458 || vid == 528 || vid == 541 || vid == 405 || vid == 551 || vid == 482 || vid == 437 || vid == 602 || vid == 470 || vid == 433)
    {
    sfl1[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,-1000,0,0,0,100);
    sfl2[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,-1000,0,0,0,100);
    sfl3[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,-1000,0,0,0,100);
    sfl4[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,-1000,0,0,0,100);
    sfl5[GetPlayerVehicleID(playerid)] = CreateObject(18646,0,0,-1000,0,0,0,100);
    if(vid == 560)
    {
    // AttachObjectToVehicle(sfl1[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.365000,2.250000,0.049999,0.000000,0.000000,0.000000);
    // AttachObjectToVehicle(sfl2[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0.405000,2.250000,0.049999,0.000000,0.000000,0.000000);
    // AttachObjectToVehicle(sfl3[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0.270000,2.275000,0.019999,0.000000,0.000000,0.000000);
    // AttachObjectToVehicle(sfl4[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.304999,2.275000,0.019999,0.000000,0.000000,0.000000);
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,0.869999,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 415)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.40,-0.035,0.62,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 405)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,0.79,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 502)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.40,-0.035,0.62,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 458)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,0.75,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 482)
    {
    //das 0.04999 ist hier die höhe
    AttachObjectToVehicle(sfl1[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.365000,2.250000,0.0399,0.000000,0.000000,0.000000);
    AttachObjectToVehicle(sfl2[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0.405000,2.250000,0.0399,0.000000,0.000000,0.000000);
    AttachObjectToVehicle(sfl3[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0.270000,2.275000,0.009,0.000000,0.000000,0.000000);
    AttachObjectToVehicle(sfl4[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.304999,2.275000,0.009,0.000000,0.000000,0.000000);
    //AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,0.75,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 528)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,1.10,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 541)
    {
    //das 0.04999 ist hier die höhe
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.40,-0.069999,0.68,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 551)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.40,-0.069999,1.0,0.000000,0.000000,0.000000);
    return 1;
    }
    else if(vid == 433)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,1.500000,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 470)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,1.15,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 602)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,0.77,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 437)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.589999,-0.069999,2.0,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 506)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.40,-0.35,0.63,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    else if(vid == 451)
    {
    AttachObjectToVehicle(sfl5[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),-0.40,-0.35,0.63,0.000000,0.000000,0.000000);
    SireneAn=1;
    return 1;
    }
    }
    }
    else if(SireneAn==1)
    {
    DestroyObject(sfl1[GetPlayerVehicleID(playerid)]);
    DestroyObject(sfl2[GetPlayerVehicleID(playerid)]);
    DestroyObject(sfl3[GetPlayerVehicleID(playerid)]);
    DestroyObject(sfl4[GetPlayerVehicleID(playerid)]);
    DestroyObject(sfl5[GetPlayerVehicleID(playerid)]);
    SireneAn=0;
    }
    }
    }
    }