Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. if(!strcmp(cmd,"/ip"))
  2. {
  3.     if(!IsPlayerAdmin(playerid)) return 1; //Se não for admin logado na RCON.
  4.     new tmp[128]; //Cria variavel
  5.     tmp=strtok(cmdtext,idx); //Pega o que foi digitado
  6.     if(!strlen(tmp)) return 1; //Se não for escrito nada, retorna 1;
  7.     if(strval(tmp)==INVALID_PLAYER_ID||!IsPlayerConnected(strval(tmp))) return 1; //Se for um ID off ou que não exista, retornará 1;
  8.     //Caso contrário ele continuará:
  9.     new minhastring[128]; //Cria variavel
  10.     new Ip[16]; //Cria variavel
  11.     GetPlayerIp(strval(tmp),Ip,16); //Pega IP e o armazena
  12.     format(minhastring,128,"Ip do ID %d: %s",strval(tmp),Ip); //Formato a mensagem
  13.     SendClientMessage(playerid,0xFF0000AA,minhastring); //Mando a mensagem formata ao admin
  14.     return 1;
  15. }