C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(95) : warning 201: redefinition of constant/macro (symbol "MAX_STRING") C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(12292) : error 017: undefined symbol "SetPDistance" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(13805) : error 021: symbol already defined: "strtok" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(13820) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(1892 : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(18973) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(1901 : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(19063) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(22404) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(22429) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(22544) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(22706) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(23006) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(23039) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(2383 : warning 219: local variable "mod" shadows a variable at a preceding level C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(25742) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(25794) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(26046) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(2623 : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(27184) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(2766 : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(29211) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(29561) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(29755) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(29819) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(30053) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(30102) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\OSCAR\Desktop\ROUTE.pwn(3020 : error 017: undefined symbol "ReturnUser" Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 26 Errors. |
stock 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))
{
userid = INVALID_PLAYER_ID;
}
else
{
return userid; // A player was found
}
}
}
// 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
}
else // Partial match
{
count++;
userid = i;
}
}
}
}
if (count != 1)
{
if (playerid != INVALID_PLAYER_ID)
{
if (count)
{
SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow search.");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "No matching user found.");
}
}
userid = INVALID_PLAYER_ID;
}
return userid; // INVALID_PLAYER_ID for bad return
}