[Ajuda] Achar o ID - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Achar o ID (
/showthread.php?tid=481519)
Achar o ID -
keller012 - 16.12.2013
Boa noite.
Estou com uma duvida. Gostaria de saber se tem alguma funзгo para que eu encontre o ID do player pelo nick dele.
Se alguйm ajudar ficaria grato.
Re: Achar o ID -
gmstrikker - 16.12.2013
Vc quer um cmd nй? Tipo /id [nomedojogador]
Ai aparece-se: Nome_Exemplo ~ id 7
??
Re: Achar o ID -
Gii - 16.12.2013
pawn Код:
CMD:id(playerid, params[]) {
new ID;
if ( sscanf(params, "u", ID) )
return SendClientMessage(playerid, -1, "/id [nome/id]");
if ( !IsPlayerConnected(ID) )
return SendClientMessage(playerid, -1, "Jogador offline!");
new Name[MAX_PLAYER_NAME];
GetPlayerName(ID, Name, MAX_PLAYER_NAME);
new wStr[39];
format (wStr, sizeof wStr, "ID %i - Nome %s", ID, Name);
SendClientMessage(playerid, -1, wStr);
return 1;
}
Re: Achar o ID -
Schocc - 16.12.2013
REMOVED
Re: Achar o ID -
Dolby - 16.12.2013
pawn Код:
stock ReturnIDByTheName(name[])
{
new strName[24];
for(new i; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
GetPlayerName(i,strName,24);
if(!strcmp(strName,name,true)) return i;
}
}
return -1;
}
Caso retorne -1, o jogador nгo estб conectado/existe.