[Duv]Return
#6

Quote:
Originally Posted by Guilherme_Canani
Isso no final do gm:

pawn Code:
ReturnUser(text[], playerid = INVALID_PLAYER_ID)
{
    new pos = 0;
    while (text[pos] < 0x21)
    {
    if (text[pos] == 0) return INVALID_PLAYER_ID;
    pos++;
    }
    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;
    }
    }
    }
    new len = strlen(text[pos]);
    new count = 0;
    new pname[MAX_PLAYER_NAME];
    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, COR_CINZA, "Hб vбrios usuбrios mъltiplos, digite o nome inteiro.");
    }
    else
    {
    SendClientMessage(playerid, COR_CINZA, "Nome do jogador nгo encontrado.");
    }
    }
    userid = INVALID_PLAYER_ID;
    }
    return userid;
}
Ou adicione o include chamado "utils"
Reply


Messages In This Thread
[Duv]Return - by (o)Trydon - 03.05.2010, 19:57
Re: [Duv]Return - by Ambrуsio - 03.05.2010, 20:11
Re: [Duv]Return - by andmeida10 - 03.05.2010, 20:15
Re: [Duv]Return - by (o)Trydon - 03.05.2010, 20:31
Re: [Duv]Return - by Guilherme_Canani - 03.05.2010, 21:43
Re: [Duv]Return - by pawNO - 05.05.2010, 16:14

Forum Jump:


Users browsing this thread: 2 Guest(s)