Zug Bot fährt falsch rum[ERLEDIGT]

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 hab ZUgBot erstellt (0.3c Standard) hab mal ne Frage warum der Zug-Bot falsch rum fährt.


    #pragma tabsize 0
    #include <a_samp>
    new TrainVehicle1;
    new TrainVehicle2;
    new TrainVehicle3;
    /*========================*/
    new PlaneVehicle1;
    new PlaneVehicle2;


    public OnFilterScriptInit()
    {
    ConnectNPC("TrainDriverLV","train_lv");
    ConnectNPC("TrainDriverLS","train_ls");
    ConnectNPC("TrainDriverSF","train_sf");


    ConnectNPC("PilotLV","at400_lv");
    ConnectNPC("PilotSF","at400_sf");

    /*================================================= */
    TrainVehicle1 = AddStaticVehicle(538, 0.0, 0.0, 5.0, 180.0, 0, 0); // Brown Streak
    TrainVehicle2 = AddStaticVehicle(538, 0.0, 0.0, 5.0, 180.0, 0, 0); // Brown Streak
    TrainVehicle3 = AddStaticVehicle(538, 0.0, 0.0, 5.0, 180.0, 0, 0); // Brown Streak
    /*================================================= */
    PlaneVehicle1 = AddStaticVehicle(577, 0.0, 0.0, 5.0, 0.0, 0, 0); //AT-400
    PlaneVehicle2 = AddStaticVehicle(577, 0.0, 0.0, 5.0, 0.0, 0, 0); //AT-400
    /*================================================= */
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    if(IsPlayerNPC(playerid)) {
    new ip_addr_npc[64+1];
    new ip_addr_server[64+1];
    GetServerVarAsString("bind",ip_addr_server,64);
    GetPlayerIp(playerid,ip_addr_npc,64);


    if(!strlen(ip_addr_server)) {
    ip_addr_server = "127.0.0.1";
    }


    if(strcmp(ip_addr_npc,ip_addr_server,true) != 0) {
    // this bot is remote connecting
    printf("NPC: Got a remote NPC connecting from %s and I'm kicking it. OWNED!",ip_addr_npc);
    Kick(playerid);
    return 0;
    }
    printf("NPC: Connection from %s is allowed.",ip_addr_npc);
    }


    return 1;
    }


    //-------------------------------------------------


    public OnPlayerRequestClass(playerid, classid)
    {
    if(!IsPlayerNPC(playerid)) return 1;


    new playername[64];
    GetPlayerName(playerid,playername,64);


    if(!strcmp(playername,"TrainDriverLV",true)) {
    SetSpawnInfo(playerid,69,255,1462.0745,0.0000,0.0000,0.0,-1,-1,-1,-1,-1,-1);
    }
    else if(!strcmp(playername,"TrainDriverSF",true)) {
    SetSpawnInfo(playerid,69,255,-1942.7950,168.4164,27.0006,0.0,-1,-1,-1,-1,-1,-1);
    }
    else if(!strcmp(playername,"TrainDriverLS",true)) {
    SetSpawnInfo(playerid,69,255,1700.7551,-1953.6531,14.8756,0.0,-1,-1,-1,-1,-1,-1);
    }
    else if(!strcmp(playername,"PilotLV",true)) {
    SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
    }
    else if(!strcmp(playername,"PilotSF",true)) {
    SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
    }
    UnFreezePlayer(playerid);
    return 0;
    }


    //-------------------------------------------------
    public OnPlayerSpawn(playerid)
    {
    if(!IsPlayerNPC(playerid)) return 1; // We only deal with NPC players in this script


    new playername[64];
    GetPlayerName(playerid,playername,64);


    if(!strcmp(playername,"TrainDriverLV",true)) {
    PutPlayerInVehicle(playerid,TrainVehicle1,0);
    }
    else if(!strcmp(playername,"TrainDriverSF",true)) {
    PutPlayerInVehicle(playerid,TrainVehicle2,0);
    }
    else if(!strcmp(playername,"TrainDriverLS",true)) {
    PutPlayerInVehicle(playerid,TrainVehicle3,0);
    }
    else if(!strcmp(playername,"PilotLV",true)) {
    PutPlayerInVehicle(playerid,PlaneVehicle1,0);
    }
    else if(!strcmp(playername,"PilotSF",true)) {
    PutPlayerInVehicle(playerid,PlaneVehicle2,0);
    }
    UnFreezePlayer(playerid);


    return 1;
    }


    stock UnFreezePlayer(playerid)
    {
    TogglePlayerControllable(playerid,true);
    }

    Warum fährt der falsch rum hab dioch alles richtig gemacht bitte helft mir


    //edit Rechtschreibung


    Bedanke dich bitte, wenn du den Beitrag als hilfreich empfandest!



    2 Mal editiert, zuletzt von ToBee94 ()

  • Versuch eine Position zu machen so das er sich umdreht :P


  • cool danke es funktioniert :thumbup::thumbup::thumbup:


    Bedanke dich bitte, wenn du den Beitrag als hilfreich empfandest!