[Pedido] Quando um player logar aparecer seu IP.
#1

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.
Reply
#2

Use GetPlayerIp e IsPlayerAdmin
Reply
#3

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
Reply
#4

Nгo funcionou /\
Reply
#5

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 .
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)