#1

-Solved-
Reply
#2

pawn Код:
GetPlayerName(i,name[i],sizeof(name[i]);
You forgot to add one more bracket, so to fix it:
pawn Код:
GetPlayerName(i,name[i],sizeof(name[i]));
That's line 13.
For the line 7, I don't know what's wrong.
Reply
#3

if(strlen(search) < strlen("333")) return SendClientMessage(playerid,COLOR_GREY,"Search length must be greater than 3.");

Should probably be:

pawn Код:
if(strlen(search) < 3) return SendClientMessage(playerid,COLOR_GREY,"Search length must be greater than 3.");
Reply
#4

-Solved.-
Reply
#5

lol @ "if(strlen(search) > strlen("twentytwentytwentytw"))"

Whatever way you wanna do it I guess, :P

As for that warning, check https://sampforum.blast.hk/showthread.php?tid=55261
Reply
#6

pawn Код:
dcmd_getid(playerid,params[])
    {
        new search[24],string[35],name[24],bool:found;
        if(sscanf(params,"u",search)) return SendClientMessage(playerid,COLOR_RED,"Usage: /getid [Playername]");
        if(!(3 < strlen(search) < 24)) return SendClientMessage(playerid,COLOR_GREY,"Search length must be greater than 3.");
        SendClientMessage(playerid, COLOR_GREY, "Results:");
        for(new i,g=GetMaxPlayers(); i < g; i++)
        {
            if(IsPlayerConnected(i))
            {
                GetPlayerName(i,name,24);
                if(strfind(search,name,true) != -1)
                {
                    format(string, sizeof(string), "%s (ID:%i)",name,i);
                    SendClientMessage(playerid, COLOR_GREY, string);
                    found=true;
                }
            }
        }
        if(!found) SendClientMessage(playerid,COLOR_RED,"No match found.");
        return 1;
    }
Reply
#7

solved, other way, friend helped. thanks all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)