| Problem - ERROR 017 |

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
  • Liebe Community,
    Ich habe einen ERROR 017 bekommen. Es muss was defined werden aber weiß nicht wie.



    C:\SA-MP Server\gamemodes\LoR-v1.pwn(167) : error 017: undefined symbol "ReturnUser"
    C:\SA-MP Server\gamemodes\LoR-v1.pwn(179) : warning 217: loose indentation
    C:\SA-MP Server\gamemodes\LoR-v1.pwn(477) : warning 235: public function lacks forward declaration (symbol "Ports")
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    1 Error.


    Die dazugehörigen Zeilen:


    new cmd[256], idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/makeadmin", true) == 0)
    {
    new string[128];
    new tmp[256];
    new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
    new giveplayerid;
    if (IsPlayerAdmin(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_HGRAD, "USAGE: /makeadmin [playerid] [level]");
    SendClientMessage(playerid, COLOR_HGRAD, "FUNCTION: Player will be an admin.");
    return 1;
    }
    giveplayerid = ReturnUser(tmp); // ERROR (Zeile 167)
    tmp = strtok(cmdtext, idx);
    new level = strval(tmp);
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, player, sizeof(player));
    sSpieler[playerid][Adminlevel] = level;
    printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
    format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level, player);
    SendClientMessage(giveplayerid, 0x00C2ECFF, string);
    format(string, sizeof(string), "You have given %s level %d admin.", giveplayer,sSpieler[playerid][Adminlevel]);
    SendClientMessage(playerid, 0x00C2ECFF, string);
    }
    else if(giveplayerid == INVALID_PLAYER_ID)
    {
    format(string, sizeof(string), "%i is not an active player.", giveplayerid);
    SendClientMessage(playerid, 0xE60000FF, string);
    }
    }
    else
    {
    SendClientMessage(playerid, 0xE60000FF, "You are not a lead admin!");
    }
    return 1;
    }


    Bitte um Hilfe. :)
    Hoffe es gibt eine Lösung




    MfG
    James.

  • Googeln hilft..

    Spoiler anzeigen
    ReturnUser(text[], playerid = INVALID_PLAYER_ID)
    {
    new pos = 0;
    while (text[pos] < 0x21)
    {
    if (text[pos] == 0) return INVALID_PLAYER_ID;
    pos++;
    }

    Spoiler anzeigen
    new userid = INVALID_PLAYER_ID;
    if (IsNumeric(text[pos]))
    {
    userid = strval(text[pos]);
    if (userid >=0 && userid < MAX_PLAYERS)
    {
    if(!IsPlayerConnected(userid))
    userid = INVALID_PLAYER_ID;
    else return userid;
    }
    }

    Spoiler anzeigen
    new len = strlen(text[pos]);
    new count = 0;
    new pname[MAX_PLAYER_NAME];

    Spoiler anzeigen
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
    if (IsPlayerConnected(i))
    {
    GetPlayerName(i, pname, sizeof (pname));
    if (strcmp(pname, text[pos], true, len) == 0)
    {
    if (len == strlen(pname)) return i;
    else
    {
    count++;
    userid = i;
    }
    }
    }
    }

    if (count != 1)
    {
    if (playerid != INVALID_PLAYER_ID)
    {
    if (count) SendClientMessage(playerid, COLOR_WHITE, "Enter the full name of the user.");
    else SendClientMessage(playerid, COLOR_GREY, "No results found for the specified phrase.");
    }
    userid = INVALID_PLAYER_ID;
    }
    return userid;
    }


    Guck mal hier vorbei: Tipps: Scripting-Probleme richtig erklären


    L.G.