[Pomoc] Error sa ReturnUser

29. Nov. 2015. Zaključano
175
pregleda
3
postova
Branko_Milovanovic
5
Crime Lord
29. Nov. 2015.
Skripta koju koristim: Ne bitno
Detaljan opis problema: Treba mi pomoc sto su mi se izbacili ovi errori sa ReturnUser ? Ne znam do cega je ovo moglo biti.
Dio skripte: Dacu sta treba.
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Vuzimir
5
Kingpin
29. Nov. 2015.
dodaj ovo u mod:
stock ReturnUser(text[], playerid = INVALID_PLAYER_ID)
{
    new pos = 0;
    while (text < 0x21) // Strip out leading spaces
    {
        if (text == 0) return INVALID_PLAYER_ID; // No passed text
        pos++;
    }
    new userid = INVALID_PLAYER_ID;
    if (IsNumeric(text)) // Check whole passed string
    {
        // If they have a numeric name you have a problem (although names are checked on id failure)
        userid = strval(text);
        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);
    new count = 0;
    new name;
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            GetPlayerName(i, name, sizeof (name));
            if (strcmp(name, text, 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
}
Branko_Milovanovic
5
Crime Lord
29. Nov. 2015.
To brate hvala ti 🙂

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha