Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Scripter Braun poslato Novembar 29, 2015, 22:59:00 POSLE PODNE

Naslov: [Pomoc] Error sa ReturnUser
Poruka od: Scripter Braun poslato Novembar 29, 2015, 22:59:00 POSLE PODNE
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):
(http://www.dodaj.rs/f/3Q/pO/2nKBO8b0/untitled.png)
Naslov: Odg: [Pomoc] Error sa ReturnUser
Poruka od: Vuzimir poslato Novembar 29, 2015, 23:09:43 POSLE PODNE
dodaj ovo u mod: [pawn]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
}[/pawn]
Naslov: Odg: [Pomoc] Error sa ReturnUser
Poruka od: Scripter Braun poslato Novembar 30, 2015, 00:25:40 PRE PODNE
To brate hvala ti :)