getid - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: getid (
/showthread.php?tid=186063)
getid -
Bessensap - 27.10.2010
-Solved-
Re: getid -
dLu - 27.10.2010
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.
Re: getid -
BMUK - 27.10.2010
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.");
Re: getid -
Bessensap - 27.10.2010
-Solved.-
Re: getid -
BMUK - 27.10.2010
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
Re: getid -
Jefff - 27.10.2010
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;
}
Re: getid -
Bessensap - 27.10.2010
solved, other way, friend helped. thanks all