SA-MP Forums Archive
[Pedido] Quando um player logar aparecer seu IP. - 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: [Pedido] Quando um player logar aparecer seu IP. (/showthread.php?tid=370305)



Quando um player logar aparecer seu IP. - Ley - 19.08.2012

Olб.
Estou querendo efetuar um script que mostre o IP do player que logar no servidor, para os administradores logados na Rcon

Alguйm poderia me dizer como fazer?
Grato.


Re: Quando um player logar aparecer seu IP. - ViniBorn - 19.08.2012

Use GetPlayerIp e IsPlayerAdmin


Re: Quando um player logar aparecer seu IP. - .FuneraL. - 19.08.2012

pawn Код:
public OnPlayerConnect(playerid)
{
     new String[128], IP[20], Nome[24];
     GetPlayerName(playerid, Nome, sizeof(Nome));
     GetPlayerIp(playerid, IP, sizeof(IP));
     format(String, sizeof(String), "[Login]: %s Logou no Servidor com o IP: %s", Nome, IP);
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
          if(IsPlayerAdmin(i))
          {
               SendClientMessage(i, -1, String);
          }
      }
      return 1;
}
Tenta Assim


Re: Quando um player logar aparecer seu IP. - Ley - 19.08.2012

Nгo funcionou /\


Re: Quando um player logar aparecer seu IP. - darkxdll - 19.08.2012

vc testou oo code sozinho?
como vai loga na rcon antes de chamar a onplayerconnect ?

edit :
a funcao certa n e :
GetPlayerIP ?
cm "P" maiusculo .


Re: Quando um player logar aparecer seu IP. - RebeloX - 19.08.2012

Quote:
Originally Posted by Ley
Посмотреть сообщение
Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
     new String[128], IP[20], Nome[24];
     GetPlayerName(playerid, Nome, sizeof(Nome));
     GetPlayerIp(playerid, IP, sizeof(IP));
     format(String, sizeof(String), "[Login]: %s Logou no Servidor com o IP: %s", Nome, IP);
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
          if(IsPlayerAdmin(i))
          {
               SendClientMessage(i, -1, String);
          }
      }
      return 1;
}
Tenta Assim
Nгo funcionou /\
Isso funciona sim, o problema й como voce esta testando sozinho nгo tem como ver, entгo faзa este cуdigo BETA:

pawn Код:
public OnPlayerConnect(playerid)
{
     new String[128], IP[20], Nome[24];
     GetPlayerName(playerid, Nome, sizeof(Nome));
     GetPlayerIp(playerid, IP, sizeof(IP));
     format(String, sizeof(String), "[Login]: %s Logou no Servidor com o IP: %s", Nome, IP);
     SendClientMessage(playerid, -1, String);
     return 1;
}
Isso como уbvio vai funcionar, mas apуs isso vocк deverб usar o cуdigo do funeral, o motivo de vocк nгo ver й por nгo estar ligado na rcon, experimente com mais um amigo.


Quote:
Originally Posted by darkxdll
Посмотреть сообщение
a funcao certa n e :
GetPlayerIP ?
cm "P" maiusculo .
й GetPlayerIp mesmo, https://sampwiki.blast.hk/wiki/GetPlayerIp