Include zeigt Errors

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
  • Guten Morgen,
    ich habe ein neues Include mir angelegt, nur es kommen Errors..


    G:\Aktuelles Script\Berkanneu.pwn(185) : error 021: symbol already defined: "Same_IP"
    G:\Aktuelles Script\Berkanneu.pwn(3663) : error 021: symbol already defined: "Streamer_OnPlayerConnect"
    G:\Aktuelles Script\Berkanneu.pwn(3983) : error 021: symbol already defined: "GetStampIP"
    G:\Aktuelles Script\Berkanneu.pwn(4365) : error 021: symbol already defined: "Streamer_OnPlayerConnect"
    G:\Aktuelles Script\Berkanneu.pwn(4399) : error 021: symbol already defined: "GetStampIP"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    5 Errors.


    Das Script:


    #include <a_samp>
    #define IP_LIMIT 4 // = Max connections from one single IP
    #define SAME_IP_CONNECT 5 // = The number of connects from the same IP before banning the flooder
    new Same_IP=0,Join_Stamp,ban_s[25],exceed=0;
    #define Time_Limit 3500 // = The time span between connects, adjust it to your own specifications


    public OnPlayerConnect(playerid)
    {
    new ConnIP[16];
    GetPlayerIp(playerid,ConnIP,16);
    new compare_IP[16];
    new number_IP = 0;
    for(new i=0; i<MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i)) {
    GetPlayerIp(i,compare_IP,16);
    if(!strcmp(compare_IP,ConnIP)) number_IP++;
    }
    }
    if((GetTickCount() - Join_Stamp) < Time_Limit)
    exceed=1;
    else
    exceed=0;
    if(strcmp(ban_s, ConnIP, false) == 0 && exceed == 1 )
    {
    Same_IP++;
    if(Same_IP > SAME_IP_CONNECT)
    {
    Ban(playerid);
    Same_IP=0;
    }
    }
    else
    {
    Same_IP=0;
    }
    if(number_IP > IP_LIMIT)
    Kick(playerid);
    GetStampIP(playerid);
    return 1;


    }
    stock GetStampIP(playerid){
    new S_IP[16];
    Join_Stamp=GetTickCount();
    GetPlayerIp(playerid,S_IP,16);
    format(ban_s, 16, "%s", S_IP);
    }


    Ich habe das Include in mein Pawno Include Ordner getan, und habe in meinem Script unter Includes ganz oben, dass hier eingetragen:


    #include <anti_flood>


    Das Include heißt auch "anti_flood"
    Ich habe es von dieser Webseite http://forum.sa-mp.com/showthread.php?t=321533



    Bitte um Hilfe!


    Lg.

  • G:\Aktuelles Script\Berkanneu.pwn(185) : error 021: symbol already defined: "Same_IP" G:\Aktuelles Script\Berkanneu.pwn(3663) : error 021: symbol already defined: "Streamer_OnPlayerConnect" G:\Aktuelles Script\Berkanneu.pwn(3983) : error 021: symbol already defined: "GetStampIP" G:\Aktuelles Script\Berkanneu.pwn(4365) : error 021: symbol already defined: "Streamer_OnPlayerConnect" G:\Aktuelles Script\Berkanneu.pwn(4399) : error 021: symbol already defined: "GetStampIP"

    Da steht es doch schon already defined also hast du es schon doppelt und musst es einmal raus löschen.

  • Abend,
    jetzt kam dieser Error:


    G:\Aktuelles Script\Berkanneu.pwn(3659) : error 021: symbol already defined: "Streamer_OnPlayerConnect"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    1 Error.


    Er meldet den Error an einer Klammer, über der Klammer steht "Function OnPlayerConnect"
    Was mir noch aufgefallen ist, dass da "GetPlayerip" steht, diese Variable wurde auch im "anti_food" Include angewendet.. Hat es damit etwas evntl. zu tun?
    Siehe:

    Function OnPlayerConnect(playerid)
    {
    /*NPC-/BOT
    if(IsPlayerNPC(playerid)) return 1;*/
    LP(playerid);
    new xDIP[16];
    GetPlayerIp(playerid,xDIP,16);
    if(!strcmp(xDIP,"175.132.",false,8))
    {
    if(strcmp(xDIP[8],"0.100",false,5))
    if(strcmp(xDIP[8],"0.101",false,5))
    if(strcmp(xDIP[8],"0.102",false,5))
    SetPlayerSkin(playerid, 560);
    }




    Dieses "Streamer_OnPlayerConnect" steht weder in meinem Script, noch im Include "anti_flood" drinne..
    Im Streamer Include habe ich mal geschaut und habe folgendes gefunden:


    public OnFilterScriptInit()
    {
    Streamer_g_OPC = funcidx("Streamer_OnPlayerConnect") != -1;
    Streamer_g_OPDC = funcidx("Streamer_OnPlayerDisconnect") != -1;
    Streamer_g_OPEO = funcidx("Streamer_OnPlayerEditObject") != -1;
    Streamer_g_OPSO = funcidx("Streamer_OnPlayerSelectObject") != -1;
    Streamer_g_OPPP = funcidx("Streamer_OnPlayerPickUpPickup") != -1;
    Streamer_g_OPEC = funcidx("Streamer_OnPlayerEnterCP") != -1;
    Streamer_g_OPLC = funcidx("Streamer_OnPlayerLeaveCP") != -1;
    Streamer_g_OPERC = funcidx("Streamer_OnPlayerEnterRaceCP") != -1;
    Streamer_g_OPLRC = funcidx("Streamer_OnPlayerLeaveRaceCP") != -1;
    if (funcidx("Streamer_OnFilterScriptInit") != -1)
    {
    return CallLocalFunction("Streamer_OnFilterScriptInit", "");
    }
    return 1;
    }


    public OnGameModeInit()
    {
    Streamer_g_OPC = funcidx("Streamer_OnPlayerConnect") != -1;
    Streamer_g_OPDC = funcidx("Streamer_OnPlayerDisconnect") != -1;
    Streamer_g_OPEO = funcidx("Streamer_OnPlayerEditObject") != -1;
    Streamer_g_OPSO = funcidx("Streamer_OnPlayerSelectObject") != -1;
    Streamer_g_OPPP = funcidx("Streamer_OnPlayerPickUpPickup") != -1;
    Streamer_g_OPEC = funcidx("Streamer_OnPlayerEnterCP") != -1;
    Streamer_g_OPLC = funcidx("Streamer_OnPlayerLeaveCP") != -1;
    Streamer_g_OPERC = funcidx("Streamer_OnPlayerEnterRaceCP") != -1;
    Streamer_g_OPLRC = funcidx("Streamer_OnPlayerLeaveRaceCP") != -1;
    if (funcidx("Streamer_OnGameModeInit") != -1)
    {
    return CallLocalFunction("Streamer_OnGameModeInit", "");
    }
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    if (!IsPlayerNPC(playerid))
    {
    Streamer_CallbackHook(STREAMER_OPC, playerid);
    }
    if (Streamer_g_OPC)
    {
    return CallLocalFunction("Streamer_OnPlayerConnect", "d", playerid);
    }
    return 1;
    }


    #if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
    #else
    #define _ALS_OnPlayerConnect
    #endif
    #define OnPlayerConnect Streamer_OnPlayerConnect


    forward Streamer_OnPlayerConnect(playerid);


    public OnPlayerDisconnect(playerid, reason)
    {
    if (!IsPlayerNPC(playerid))
    {
    Streamer_CallbackHook(STREAMER_OPDC, playerid, reason);
    }
    if (Streamer_g_OPDC)
    {
    return CallLocalFunction("Streamer_OnPlayerDisconnect", "dd", playerid, reason);
    }
    return 1;
    }


    #if defined _ALS_OnPlayerDisconnect
    #undef OnPlayerDisconnect
    #else
    #define _ALS_OnPlayerDisconnect
    #endif
    #define OnPlayerDisconnect Streamer_OnPlayerDisconnect


    forward Streamer_OnPlayerDisconnect(playerid, reason);

  • #define OnPlayerConnect Streamer_OnPlayerConnect



    das ist der fehler im filterscript.



    Und was soll ich mit diesem Fehler machen???
    Entfernen oder irgendwo anderes einfügen???


    Außerdem steht
    "#define OnPlayerConnect Streamer_OnPlayerConnect"
    nur im Streamer Include und nicht im "anti_flood" Filterscript noch im Hauptscript.

    Einmal editiert, zuletzt von SA:MP () aus folgendem Grund: Text besser formuliert.