Problem mit NPC Filterscript

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
  • Moin Leude,
    und zwar möchte ich gern ein Bot übers Filterscript connecten lassen, was leider nicht klappt...
    Der NPC soll zu Fuß unterwegs sein :)
    Ich weiß einfach nicht weiter, hier mal die ganzen .pwn Datein:


    NPC.pwn:

    • Spoiler anzeigen

      #define RECORDING "GodModeTester"
      #define RECORDING_TYPE 2


      #include <a_npc>
      main(){}
      public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);


      public OnNPCModeInit(){
      print("GodModeTester 1");
      return 1;}


      #if RECORDING_TYPE == 1
      public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
      public OnNPCExitVehicle() StopRecordingPlayback();
      #else
      public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
      #endif


    Filterscript.pwn:

    • Spoiler anzeigen

      #include <a_npc>


      ...


      public OnFilterScriptInit(){
      ConnectNPC("GodModeTester","GodModeTester");
      return 1;}


      ...


      public OnPlayerConnect(playerid){
      if(IsPlayerNPC(playerid)){
      new botname[MAX_PLAYER_NAME];
      GetPlayerName(playerid, botname, sizeof(botname));
      if(!strcmp(botname, "GodModeTester", true)){
      print("GodModeTester connectet.");}
      return 1;}
      return 1;}


      public OnPlayerDisconnect(playerid, reason){
      if(IsPlayerNPC(playerid)){
      print("GodModeTester disconnectet.");}
      return 1;}


      public OnPlayerSpawn(playerid){
      if(IsPlayerNPC(playerid)){
      new botname[MAX_PLAYER_NAME];
      GetPlayerName(playerid, botname, sizeof(botname));
      if(!strcmp(botname, "GodModeTester", true)){
      SetPlayerSkin(playerid, 217);
      GivePlayerWeapon(playerid, 38, 999999999);
      SetPlayerPos(playerid, 1390.40002441,-23.79999924,1000.59997559);
      SetPlayerVirtualWorld(playerid, 100);
      SetPlayerInterior(playerid, 1);
      SetPlayerColor(playerid, 0xFFFFFF00);}
      return 1;}
      return 1;}


    Gamemode.pwn:

    • Spoiler anzeigen

      Jeweils bei OnPlayerConnect, OnPlayerSpawn und OnPlayerRequestClass mit
      if(!IsPlayerNPC(playerid))
      angefangen und am Ende die Abfrage mit } geschlossen.


    Config:
    Spoiler anzeigen
    maxnpc 10
    npcmode GodModeTester


    Komme einfach nicht weiter :(


    MfG Farid

  • Server Log:

    Spoiler anzeigen

    ----------
    Loaded log file: "server_log.txt".
    ----------

    Spoiler anzeigen
    SA-MP Dedicated Server
    ----------------------
    v0.3e, (C)2005-2012 SA-MP Team

    Spoiler anzeigen
    [19:09:15]
    [19:09:15] Server Plugins
    [19:09:15] --------------
    [19:09:15] Loading plugin: streamer
    [19:09:15]

    Spoiler anzeigen
    *** Streamer Plugin v2.6.1 by Incognito loaded ***

    Spoiler anzeigen
    [19:09:15] Loaded.
    [19:09:15] Loaded 1 plugins.

    Spoiler anzeigen
    [19:09:15]
    [19:09:15] Filterscripts
    [19:09:15] ---------------
    [19:09:15] Loading filterscript 'GodModeTester.amx'...
    [19:09:15]
    --------------------------------------
    [19:09:15] GodModeTester geladen...
    [19:09:15] --------------------------------------

    Spoiler anzeigen
    [19:09:15] Loaded 1 filterscripts.

    Spoiler anzeigen
    [19:09:15]
    ----------------------------------
    [19:09:15] Trainings Script ist geladen...
    [19:09:15] ----------------------------------

    Spoiler anzeigen
    [19:09:15] Number of vehicle models: 11
    [19:09:20] --- Server Shutting Down.
    [19:09:20]
    --------------------------------------
    [19:09:20] GodModeTester entladen...
    [19:09:20] --------------------------------------

    Spoiler anzeigen
    [19:09:20]

    Spoiler anzeigen
    *** Streamer Plugin v2.6.1 by Incognito unloaded ***

  • Da stimmt was nicht:
    define RECORDING "GodModeTester"
    #define RECORDING_TYPE 2


    #include <a_npc>
    main(){}
    public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);


    public OnNPCModeInit(){
    print("GodModeTester 1");
    return 1;}


    #if RECORDING_TYPE == 1
    public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
    public OnNPCExitVehicle() StopRecordingPlayback();
    #else
    public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
    #endif
    Und da stimmt was nicht.
    #include <a_npc>


    ...


    public OnFilterScriptInit(){
    ConnectNPC("GodModeTester","GodModeTester");
    return 1;}


    ...


    public OnPlayerConnect(playerid){
    if(IsPlayerNPC(playerid)){
    new botname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, botname, sizeof(botname));
    if(!strcmp(botname, "GodModeTester", true)){
    print("GodModeTester connectet.");}
    return 1;}
    return 1;}


    public OnPlayerDisconnect(playerid, reason){
    if(IsPlayerNPC(playerid)){
    print("GodModeTester disconnectet.");}
    return 1;}


    public OnPlayerSpawn(playerid){
    if(IsPlayerNPC(playerid)){
    new botname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, botname, sizeof(botname));
    if(!strcmp(botname, "GodModeTester", true)){
    SetPlayerSkin(playerid, 217);
    GivePlayerWeapon(playerid, 38, 999999999);
    SetPlayerPos(playerid, 1390.40002441,-23.79999924,1000.59997559);
    SetPlayerVirtualWorld(playerid, 100);
    SetPlayerInterior(playerid, 1);
    SetPlayerColor(playerid, 0xFFFFFF00);}
    return 1;}
    return 1;}


    Die Fehler sind simpel. Wenn du wirklich nicht drauf kommst, sende mir eine PN...


    Gruss: Sonic

    I didn't hit you. I high fived your face.