Guys can anyone give me a hand on this?
#1

Ok here is the error

Код:
error 017: undefined symbol "ReturnUser"
Here is the script piece it is having a problem with.

Код:
giveplayerid = ReturnUser(tmp);
This is suppose to be for a admin command. Can anyone tell me how to define ReturnUser?
Reply
#2

Well, if you just goto the top of the script, in blue there should be a load of things e.g.

#define [Something]

Well at the top with all the defines, just put:

#define ReturnUser

What script are you running ?
Reply
#3

Its a edit of ZORP and Nazi Zombie TDM registration. I have one problem left tho, I can't get my teams/factions to save and when you relog choose that faction in the menu. I don't know how its now letting it. It changes the Team your in but only thru teamid.
Reply
#4

Add this code to somewhere 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
}
Reply
#5

Thank you it worked . Can you help me with my team/faction problem as well?
Reply
#6

Hey, sorry that i couldn't help lol, and i don't know, sorry, and good luck with your server!
Reply
#7

Quote:
Originally Posted by Jaze [Hugu-hosting.co.uk
]
Hey, sorry that i couldn't help lol, and i don't know, sorry, and good luck with your server!
Well thanks for trying .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)