Problem mit Makeleader

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
  • ich hab ein problem mit den makeleader befehl




    Errors:
    C:\Dokumente und Einstellungen\Ramon123455687578686\Desktop\Los Ageles Reallife Pro\gamemodes\Untitled.pwn(1653) : error 017: undefined symbol "ReturnUser"Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    1 Error.



    Zeilen:
    if(strcmp(cmd, "/makeleader", true) == 0) {
    if(IsPlayerConnected(playerid)) {
    tmp = strtok(cmdtext, idx); if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /makeleader [Name oder ID] [Number(1-13)]"); return 1; }
    new para1; new level; para1 = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx); level = strval(tmp);
    if(level > 19 || level < 0) { SendClientMessage(playerid, COLOR_GREY, " Inkorrekte Angabe"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 1337) { if(IsPlayerConnected(para1)) {
    if(para1 != INVALID_PLAYER_ID) {
    if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255) {
    SendClientMessage(playerid, COLOR_GREY, " That player is in a Faction / Family !"); return 1; }
    GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername));
    PlayerInfo[para1][pLeader] = level; format(string, sizeof(string), " Du Wurdest von Admin: %s zu Leader einer Family gemacht", sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), " Du Hast %s Leader von einer Family gemacht (Family ID: %d).", giveplayer,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); if(level == 0) { PlayerInfo[para1][pChar] = 0; }
    else if(level == 1) { PlayerInfo[para1][pChar] = 265; } //LSPD else if(level == 2) { PlayerInfo[para1][pChar] = 287; } //SF ARMY else if(level == 3) { PlayerInfo[para1][pChar] = 287; } //LS ARMY
    else if(level == 4) { PlayerInfo[para1][pChar] = 274; } //LS MEDIC else if(level == 5) { PlayerInfo[para1][pChar] = 297; } //CRIPZ else if(level == 6) { PlayerInfo[para1][pChar] = 19; } //BLOODZ
    else if(level == 7) { PlayerInfo[para1][pChar] = 141; } // LS PRESI else if(level == 8) { PlayerInfo[para1][pChar] = 68; } //Hitmans
    else if(level == 9) { PlayerInfo[para1][pChar] = 272; } //News Reporters else if(level == 10) { PlayerInfo[para1][pChar] = 112; } //Taxi Cab Company else if(level == 11) { PlayerInfo[para1][pChar] = 46; } //Driving/Flying School else if(level == 12) { PlayerInfo[para1][pChar] = 115; }
    else if(level == 13) { PlayerInfo[para1][pChar] = 267; } //San Fierro Polizei else if(level == 14) { PlayerInfo[para1][pChar] = 275; } //San Fierro Sanitäter else if(level == 15) { PlayerInfo[para1][pChar] = 295; } //San Fierro President else if(level == 16) { PlayerInfo[para1][pChar] = 278; } //Feuerwehr
    else if(level == 17) { PlayerInfo[para1][pChar] = 166; } //NSA else if(level == 18) { PlayerInfo[para1][pChar] = 164; } //Secret Service else if(level == 19) { PlayerInfo[para1][pChar] = 142; } //Terroristen gTeam[para1] = 12; PlayerInfo[para1][pTeam] = 12; SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
    } }//not connected } else
    { SendClientMessage(playerid, COLOR_GRAD1, " Du bist nicht berechtigt"); } }
    return 1; }

  • ReturnUser(text[], playerid = INVALID_PLAYER_ID)
    {
    new pos = 0;
    while (text[pos] < 0x21) // Strip out leading spaces
    {
    if (text[pos] == 0) return INVALID_PLAYER_ID; // No passed text
    pos++;
    }
    new userid = INVALID_PLAYER_ID;
    if (IsNumeric(text[pos])) // Check whole passed string
    {
    // If they have a numeric name you have a problem (although names are checked on id failure)
    userid = strval(text[pos]);
    if (userid >=0 && userid < MAX_PLAYERS)
    {
    if(!IsPlayerConnected(userid))
    {
    /*if (playerid != INVALID_PLAYER_ID)
    {
    SendClientMessage(playerid, 0xFF0000AA, "User not connected");
    }*/
    userid = INVALID_PLAYER_ID;
    }
    else
    {
    return userid; // A player was found
    }
    }
    /*else
    {
    if (playerid != INVALID_PLAYER_ID)
    {
    SendClientMessage(playerid, 0xFF0000AA, "Invalid user ID");
    }
    userid = INVALID_PLAYER_ID;
    }
    return userid;*/
    // Removed for fallthrough code
    }
    // They entered [part of] a name or the id search failed (check names just incase)
    new len = strlen(text[pos]);
    new count = 0;
    new name[MAX_PLAYER_NAME];
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
    if (IsPlayerConnected(i))
    {
    GetPlayerName(i, name, sizeof (name));
    if (strcmp(name, text[pos], true, len) == 0) // Check segment of name
    {
    if (len == strlen(name)) // Exact match
    {
    return i; // Return the exact player on an exact match
    // Otherwise if there are two players:
    // Me and MeYou any time you entered Me it would find both
    // And never be able to return just Me's id
    }
    else // Partial match
    {
    count++;
    userid = i;
    }
    }
    }
    }
    if (count != 1)
    {
    if (playerid != INVALID_PLAYER_ID)
    {
    if (count)
    {
    SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow earch");
    }
    else
    {
    SendClientMessage(playerid, 0xFF0000AA, "No matching user found");
    }
    }
    userid = INVALID_PLAYER_ID;// INVALID_USER_ID for bad return
    }
    return userid;
    }

    Hyper Code

    Wir entwickeln professionelle Ressourcen für FiveM, die auf verschiedenste Bedürfnisse zugeschnitten sind

    und stellen dabei stets die Kundenzufriedenheit in den Mittelpunkt.

    Mit einer Vielzahl von Ressourcen hast du zahlreiche Anpassungsmöglichkeiten, um sie zu deinem eigenen Projekt zu machen. Jede Ressource ist etwas Besonderes, da wir viel Liebe und Sorgfalt in alles stecken, was wir erschaffen.


    Besucht uns unter

    https://hyper-code.eu oder im Discord unter discord.gg/hypercode