Bot Problem

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
  • Tag Community,


    Ich habe jetzt mal 2 Bost eingefügt jedoch connecten diese und disconnecten sofort wieder.


    SQL
    [12:43:08] [npc:join] Sheva_Alomar has joined the server (0:176.9.44.136)
    [12:43:08] [npc:join] Benett_Sinclair has joined the server (1:176.9.44.136)
    [12:43:09] [npc:part] Sheva_Alomar has left the server (0:2)
    [12:43:09] [npc:part] Benett_Sinclair has left the server (1:2)


    Ich lasse diese normal Connecten.



    public OnPlayerConnect(playerid)
    {
    if(IsPlayerNPC(playerid))
    {
    new botname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, botname, sizeof(botname));
    if(!strcmp(botname, "Sheva_Alomar", true))
    {
    SetPVarInt(playerid,"logged",1);
    }
    else if(!strcmp(botname,"Benett_Sinclair",true))
    {
    SetPVarInt(playerid,"logged",1);
    }
    }
    }

    MFG

  • Das kommt vor, wenn du kein entsprechendes Botscript im npcmodes Ordner hast bzw. dazu keine .rec Datei unter npcmodes/recordings.


    LG

    Main: CPU: Intel Core i5-4440 @ 3,10 GHz | CPU-Cooling: Matterhorn -PURE- | RAM: 16GB Crucial Ballistix Sport DDR3-1600 DIMM CL9-9-9-24 |
    Motherboard: ASRock B85M Pro4 | GPU: Sapphire Radeon R9 390X Nitro 8GB GDDR5 |

    SSD: Samsung SSD 840 Evo 500GB | Power Supply: 550 Watt Corsair CS Series Modular 80+ Gold | Case: beQuiet! Silent Base 800


    As I walk through the valley of the shadow of death
    I take a look at my life and realize there's nothin' left.

  • Und was ist mit dem Botscript bzw. dessen .amx Datei ?

    Main: CPU: Intel Core i5-4440 @ 3,10 GHz | CPU-Cooling: Matterhorn -PURE- | RAM: 16GB Crucial Ballistix Sport DDR3-1600 DIMM CL9-9-9-24 |
    Motherboard: ASRock B85M Pro4 | GPU: Sapphire Radeon R9 390X Nitro 8GB GDDR5 |

    SSD: Samsung SSD 840 Evo 500GB | Power Supply: 550 Watt Corsair CS Series Modular 80+ Gold | Case: beQuiet! Silent Base 800


    As I walk through the valley of the shadow of death
    I take a look at my life and realize there's nothin' left.

  • Da stellt sich immer zuerst die Fragen . Recordfile vorhanden , maxnpc gesetzt in der server.cfg.


    Du kannst dir ja zusätzlich noch den grund ausgeben lassen warum er vom server unten ist

    public OnNPCDisconnect(reason[])
    {
    printf("%s", reason);
    }

  • Und was ist mit dem Botscript bzw. dessen .amx Datei ?


    Auch drinne


    Soll ich dass dann bei ONPlayerDisconnect aufrufen oder was?
    Weil da kommt ja : public function lacks forward declaration (symbol "OnNPCDisconnect") dass ich einen forward einfügen soll.

    MFG

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • public OnNPCDisconnect(reason[])
    {
    printf("%s", reason);
    }
    Dann bekommst den Grund warum der NPC wieder disconnected. Wäre sehr nützlich für Leute um dir zu helfen! :)


    Habe ich schon versucht.
    Ich habe den public eingefügt, dann kommt folgendes beim Compilen :
    public function lacks forward declaration (symbol "OnNPCDisconnect")


    Danach habe ich einen forward gemacht :



    forward OnNPCDisconnect(reason[]);
    public OnNPCDisconnect(reason[])
    {
    printf("%s", reason);
    }


    Dann rief er den public nicht auf, dann habe ich das mal unter OnPlayerDisconnect gestellt :
    und da kommt dieser Error .
    error 017: undefined symbol "OnNPCDisconnct"
    obwohl ich es eingefügt habe.


    //edit


    Jetzt habe ich einfach mal so gemacht bei Disconnect :

    printf("Dis Grund : %s",reason);

    Und da kommt jetzt folgendes aus der Log :


    Code
    [14:22:38] Dis Grund : ´P

    MFG

  • [DT]Nightstr3am:
    Du sollst das ganze ja auch in deinem Botscript einfügen, nicht in deinen GM!
    Im Botscript inkludierst du ja a_npc, da wird der Callback schon automatisch geforwardet!


    LG

    Main: CPU: Intel Core i5-4440 @ 3,10 GHz | CPU-Cooling: Matterhorn -PURE- | RAM: 16GB Crucial Ballistix Sport DDR3-1600 DIMM CL9-9-9-24 |
    Motherboard: ASRock B85M Pro4 | GPU: Sapphire Radeon R9 390X Nitro 8GB GDDR5 |

    SSD: Samsung SSD 840 Evo 500GB | Power Supply: 550 Watt Corsair CS Series Modular 80+ Gold | Case: beQuiet! Silent Base 800


    As I walk through the valley of the shadow of death
    I take a look at my life and realize there's nothin' left.

  • [DT]Nightstr3am:
    Du sollst das ganze ja auch in deinem Botscript einfügen, nicht in deinen GM!
    Im Botscript inkludierst du ja a_npc, da wird der Callback schon automatisch geforwardet!


    LG


    Mhm, habe ich jetzt drunter geschrieben...

    #include <a_npc>
    #define RECORDING "hilfe"


    main()
    {
    }


    public OnRecordingPlaybackEnd()
    {
    StartRecordingPlayback(2, RECORDING);
    }


    public OnNPCExitVehicle()
    {
    StartRecordingPlayback(2, RECORDING);
    }


    public OnNPCSpawn()
    {
    StartRecordingPlayback(2, RECORDING);
    }


    public OnNPCDisconnect(reason[])
    {
    printf("%s", reason);
    }

    Kommt aber immer noch das gleiche raus.

    Code
    [14:31:28] Incoming connection: 176.9.44.136:40842
    [14:31:28] Incoming connection: 176.9.44.136:55135
    [14:31:29] [npc:join] Sheva_Alomar has joined the server (0:176.9.44.136)
    [14:31:29] [npc:join] Benett_Sinclair has joined the server (1:176.9.44.136)
    [14:31:29] [npc:part] Sheva_Alomar has left the server (0:2)
    [14:31:29] [npc:part] Benett_Sinclair has left the server (1:2)


    //edit push