Supporter Car

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(SupCar[playerid] != 999)
    {
    DestroyVehicle(SupCar[playerid]);
    SupCar[playerid] = 999;


    }


    if(!strcmp(cmd, "/supcar", true))
    {
    if(PlayerInfo[playerid][pAdmin] < 1)
    {
    return SendClientMessage(playerid, COLOR_RED, "* Du bist nicht befugt.");
    }
    if(SupCar[playerid] != 999)
    {
    DestroyVehicle(SupCar[playerid]);
    SendClientMessage(playerid, COLOR_LIGHTRED, "* Supporterfahrzeug gelöscht.");
    SupCar[playerid] = 999;
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_supcar,DIALOG_STYLE_MSGBOX,"Suppcar","Welches fahrzeug möchtest du haben.","NRG","Sultan");
    }
    return 1;
    }




    if(dialogid == DIALOG_supcar)
    {
    if(response)
    {
    new Float:xb, Float:yb, Float:zb, Float:zab;
    GetPlayerPos(playerid, xb, yb, zb);
    GetPlayerFacingAngle(playerid, zab);
    SupCar[playerid] = CreateVehicle(522, xb, yb, zb, zab, 22, 22, -1);
    PutPlayerInVehicle(playerid, SupCar[playerid], 0);
    SendClientMessage(playerid, COLOR_GREEN, "* Supportercar erstellt.");
    new VID;
    new FillUp;
    VID = GetPlayerVehicleID(playerid);
    FillUp = GetGasMax(GetVehicleModel(VID)) - Gas[VID];
    Gas[VID] += FillUp;



    new pname[MAX_PLAYERS];
    GetPlayerName(playerid,pname,sizeof pname);
    new adminmeldung[128];
    SendAdminMessage(0xFF0069FF,"------------------------------- [ Supportercar] -------------------------------");
    format(adminmeldung, sizeof(adminmeldung), "%s [ID: %d] hat sich ein Supporterfahrzeug gespawnt.", pname,playerid);
    SendAdminMessage(COLOR_GRAD1, adminmeldung);
    return 1;
    }
    else
    {
    new Float:xb, Float:yb, Float:zb, Float:zab;
    GetPlayerPos(playerid, xb, yb, zb);
    GetPlayerFacingAngle(playerid, zab);
    SupCar[playerid] = CreateVehicle(560, xb, yb, zb, zab, 128, 128, -1);
    PutPlayerInVehicle(playerid, SupCar[playerid], 0);
    SendClientMessage(playerid, COLOR_GREEN, "* Supportercar erstellt.");
    SetVehicleNumberPlate(SupCar[playerid], "LiS-Admin");
    new VID;
    new FillUp;
    VID = GetPlayerVehicleID(playerid);
    FillUp = GetGasMax(GetVehicleModel(VID)) - Gas[VID];
    Gas[VID] += FillUp;


    new string[128];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s hat sich ein Supporterfahrzeug gespawnt.", sendername);
    ABroadCast(0x00F5FFFF,string,4);
    return 1;
    }
    }


    Wie kann ich Tuningteile auf den Sultan machen?

  • if(dialogid == DIALOG_supcar)
    {
    if(response)
    {
    new Float:xb, Float:yb, Float:zb, Float:zab;
    GetPlayerPos(playerid, xb, yb, zb);
    GetPlayerFacingAngle(playerid, zab);
    SupCar[playerid] = CreateVehicle(522, xb, yb, zb, zab, 22, 22, -1);
    PutPlayerInVehicle(playerid, SupCar[playerid], 0);
    SendClientMessage(playerid, COLOR_GREEN, "* Supportercar erstellt.");
    SetVehicleNumberPlate(SupCar[playerid], "LiS-Admin");
    AddVehicleComponent(560, 1010);
    AddVehicleComponent(560, 1028);
    AddVehicleComponent(560, 1031);
    AddVehicleComponent(560, 1033);
    new VID;
    new FillUp;
    VID = GetPlayerVehicleID(playerid);
    FillUp = GetGasMax(GetVehicleModel(VID)) - Gas[VID];
    Gas[VID] += FillUp;



    new pname[MAX_PLAYERS];
    GetPlayerName(playerid,pname,sizeof pname);
    new adminmeldung[128];
    SendAdminMessage(0xFF0069FF,"------------------------------- [ Supportercar] -------------------------------");
    format(adminmeldung, sizeof(adminmeldung), "%s [ID: %d] hat sich ein Supporterfahrzeug gespawnt.", pname,playerid);
    SendAdminMessage(COLOR_GRAD1, adminmeldung);
    return 1;
    }
    else
    {
    new Float:xb, Float:yb, Float:zb, Float:zab;
    GetPlayerPos(playerid, xb, yb, zb);
    GetPlayerFacingAngle(playerid, zab);
    SupCar[playerid] = CreateVehicle(560, xb, yb, zb, zab, 128, 128, -1);
    PutPlayerInVehicle(playerid, SupCar[playerid], 0);
    SendClientMessage(playerid, COLOR_GREEN, "* Supportercar erstellt.");
    new VID;
    new FillUp;
    VID = GetPlayerVehicleID(playerid);
    FillUp = GetGasMax(GetVehicleModel(VID)) - Gas[VID];
    Gas[VID] += FillUp;


    new string[128];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s hat sich ein Supporterfahrzeug gespawnt.", sendername);
    ABroadCast(0x00F5FFFF,string,4);
    return 1;
    }
    }


    Stimmt das so?

  • Willst du die Tuningteile nur auf den Sultan haben?... Wenn ja probier es mal so:


    Oben im Script:


    new AdminVehicles[MAX_VEHICLES];


    Und dann unter OnDialogResponse


    if(dialogid==DIALOG_supcar)
    {
    new Float:VehPos[4], vehicleid;
    if(response)
    {
    GetPlayerPos(playerid, VehPos[0],VehPos[1],VehPos[2]);
    GetPlayerFacingAngle(playerid, VehPos[3]);
    vehicleid = CreateVehicle(522,VehPos[0],VehPos[1],VehPos[2],VehPos[3],-1,-1,-1);//NRG-500 (522)
    PutPlayerInVehicle(playerid,vehicleid,0);
    AdminVehicles[vehicleid] = 1;
    SendClientMessage(playerid, COLOR_GREEN, "* Supportercar erstellt.");
    SetVehicleNumberPlate(vehicleid, "LiS-Admin");
    new VID;
    new FillUp;
    VID = GetPlayerVehicleID(playerid);
    FillUp = GetGasMax(GetVehicleModel(VID)) - Gas[VID];
    Gas[VID] += FillUp;
    new pname[MAX_PLAYERS];
    GetPlayerName(playerid,pname,sizeof pname);
    new adminmeldung[128];
    SendAdminMessage(0xFF0069FF,"------------------------------- [ Supportercar] -------------------------------");
    format(adminmeldung, sizeof(adminmeldung), "%s [ID: %d] hat sich ein Supporterfahrzeug gespawnt.", pname,playerid);
    SendAdminMessage(COLOR_GRAD1, adminmeldung);
    }
    else
    {
    GetPlayerPos(playerid, VehPos[0],VehPos[1],VehPos[2]);
    GetPlayerFacingAngle(playerid, VehPos[3]);
    vehicleid = CreateVehicle(560,VehPos[0],VehPos[1],VehPos[2],VehPos[3],-1,-1,-1);//Sultan (560)
    AddVehicleComponent(vehicleid, 1010);
    AddVehicleComponent(vehicleid, 1028);
    AddVehicleComponent(vehicleid, 1031);
    AddVehicleComponent(vehicleid, 1033);
    PutPlayerInVehicle(playerid,vehicleid,0);
    AdminVehicles[vehicleid] = 1;
    SendClientMessage(playerid, COLOR_GREEN, "* Supportercar erstellt.");
    new VID;
    new FillUp;
    VID = GetPlayerVehicleID(playerid);
    FillUp = GetGasMax(GetVehicleModel(VID)) - Gas[VID];
    Gas[VID] += FillUp;
    new string[128];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s hat sich ein Supporterfahrzeug gespawnt.", sendername);
    ABroadCast(0x00F5FFFF,string,4);
    return 1;
    }
    }


    Mit freundlichen Grüßen
    German_ScripterHD

    Einmal editiert, zuletzt von German_ScripterHD ()

  • #define DIALOG_AdminVehicles 9673
    new AdminVehicles[MAX_VEHICLES];


    if(AdminVehicles[playerid] != 999)
    {
    DestroyVehicle(AdminVehicles[playerid]);
    AdminVehicles[playerid] = 999;


    }


    if(AdminVehicles[playerid] != 999)
    {
    DestroyVehicle(AdminVehicles[playerid]);
    AdminVehicles[playerid] = 999;


    }


    if(!strcmp(cmd, "/supcar", true))
    {
    if(PlayerInfo[playerid][pAdmin] < 1)
    {
    return SendClientMessage(playerid, COLOR_RED, "* Du bist nicht befugt.");
    }
    if(AdminVehicles[playerid] != 999)
    {
    DestroyVehicle(AdminVehicles[playerid]);
    SendClientMessage(playerid, COLOR_LIGHTRED, "* Supporterfahrzeug gelöscht.");
    AdminVehicles[playerid] = 999;
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_AdminVehicles,DIALOG_STYLE_MSGBOX,"Suppcar","Welches fahrzeug möchtest du haben.","NRG","Sultan");
    }
    return 1;
    }


    if(dialogid==DIALOG_AdminVehicles)
    {
    new Float:VehPos[4], vehicleid;
    if(response)
    {
    GetPlayerPos(playerid, VehPos[0],VehPos[1],VehPos[2]);
    GetPlayerFacingAngle(playerid, VehPos[3]);
    vehicleid = CreateVehicle(522,VehPos[0],VehPos[1],VehPos[2],VehPos[3],-1,-1,-1);//NRG-500 (522)
    PutPlayerInVehicle(playerid,vehicleid,0);
    AdminVehicles[vehicleid] = 1;
    SendClientMessage(playerid, COLOR_GREEN, "* Supportercar erstellt.");
    SetVehicleNumberPlate(vehicleid, "LiS-Admin");
    new VID;
    new FillUp;
    VID = GetPlayerVehicleID(playerid);
    FillUp = GetGasMax(GetVehicleModel(VID)) - Gas[VID];
    Gas[VID] += FillUp;
    new pname[MAX_PLAYERS];
    GetPlayerName(playerid,pname,sizeof pname);
    new adminmeldung[128];
    SendAdminMessage(0xFF0069FF,"------------------------------- [ Supportercar] -------------------------------");
    format(adminmeldung, sizeof(adminmeldung), "%s [ID: %d] hat sich ein Supporterfahrzeug gespawnt.", pname,playerid);
    SendAdminMessage(COLOR_GRAD1, adminmeldung);
    }
    else
    {
    GetPlayerPos(playerid, VehPos[0],VehPos[1],VehPos[2]);
    GetPlayerFacingAngle(playerid, VehPos[3]);
    vehicleid = CreateVehicle(560,VehPos[0],VehPos[1],VehPos[2],VehPos[3],-1,-1,-1);//Sultan (560)
    AddVehicleComponent(vehicleid, 1010);
    AddVehicleComponent(vehicleid, 1028);
    AddVehicleComponent(vehicleid, 1033);
    AddVehicleComponent(vehicleid, 1030);
    AddVehicleComponent(vehicleid, 1139);
    AddVehicleComponent(vehicleid, 1169);
    AddVehicleComponent(vehicleid, 1141);
    AddVehicleComponent(vehicleid, 1080);
    AddVehicleComponent(vehicleid, 1086);
    PutPlayerInVehicle(playerid,vehicleid,0);
    AdminVehicles[vehicleid] = 1;
    SendClientMessage(playerid, COLOR_GREEN, "* Supportercar erstellt.");
    new VID;
    new FillUp;
    VID = GetPlayerVehicleID(playerid);
    FillUp = GetGasMax(GetVehicleModel(VID)) - Gas[VID];
    Gas[VID] += FillUp;
    new string[128];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s hat sich ein Supporterfahrzeug gespawnt.", sendername);
    ABroadCast(0x00F5FFFF,string,4);
    return 1;
    }
    }


    Man kann so oft eins erstellen normal sollte man nur eins erstellen könn wen man wider /supcar eingiebt löscht sich das warum löscht sich das nicht ?