SA-MP Forums Archive
Only error "ReturnUser" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Only error "ReturnUser" (/showthread.php?tid=91447)



Only error "ReturnUser" - Typhome - 14.08.2009

Код:
C:\Users\Martin\Desktop\moneygrub\mg.pwn(458) : error 017: undefined symbol "ReturnUser"
C:\Users\Martin\Desktop\moneygrub\mg.pwn(514) : error 017: undefined symbol "ReturnUser"
C:\Users\Martin\Desktop\moneygrub\mg.pwn(572) : error 017: undefined symbol "ReturnUser"
C:\Users\Martin\Desktop\moneygrub\mg.pwn(612) : error 017: undefined symbol "ReturnUser"



Re: Only error "ReturnUser" - Nero_3D - 14.08.2009

that errors means that you use somewhere a function called "ReturnUser" but it cant find it in your script
You just need to search for the ReturnUser stock and put it to your script


Re: Only error "ReturnUser" - Typhome - 14.08.2009

Here full code:

http://pastebin.com/m37f21cec


Re: Only error "ReturnUser" - Nero_3D - 14.08.2009

Lol

Quote:
Originally Posted by Matuu
I never asked for any code :S

Quote:
Originally Posted by ♣ ⓐⓢⓢ
that errors means that you use somewhere a function called "ReturnUser" but it cant find it in your script
You just need to search for the ReturnUser stock and put it to your script
Just add this code in your script

pawn Код:
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;
    }
    return userid; // INVALID_USER_ID for bad return
}
Oh wow I used the search bottom!