SA-MP Forums Archive
[Ajuda] IP Player - 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] IP Player (/showthread.php?tid=647461)



IP Player - BuDweiSeR - 05.01.2018

Galera, Como faзo para pegar IP de um Player e б hora que ele se conectou ao server e mostrar numa dialog?

Alguйm poderia me ensinar?


Re: IP Player - ipsLuan - 05.01.2018

pega as informaзхes dele com GetPlayerIp e joga na dialog com format


Re: IP Player - klap - 05.01.2018

pow, pergunta complicada explicar sem fazer xD

mas resumindo

vc pega o ip com um metodo lб
ai abre um dialog tb com outro metodo e coloca o ip no texto, usando o format e tag para inserir string "%s"

coloca o id do dialog um id que vc nao usa para nao ter aзгo nenhuma, e foi


Re: IP Player - victorara - 05.01.2018

Quote:
Originally Posted by klap
Посмотреть сообщение
vc pega o ip com um metodo lб
ai abre um dialog tb com outro metodo
" P: ei onde vc mora ? "
" R: eu moro la "


Re: IP Player - IlanZ - 05.01.2018

PHP код:
public OnPlayerConnect(playerid)
{
    new 
IP[25], time[6], string_[128];
    
GetPlayerIp(playeridIPsizeof(IP));
    
gettime(time[0], time[1], time[2]);
    
getdate(time[5], time[4], time[3]);
    
format(string_sizeof(string_), "IP:%s\nConectou as: %02d:%02d:%02d - %02d/%02d/%02d"
    
IP,
    
time[0],
    
time[1],
    
time[2],
    
time[3],
    
time[4],
    
time[5],
    );
    
ShowPlayerDialog(playerid666DIALOG_STYLE_MSGBOX"sei la"string_"bah""fodase");
    return 
1;




Re: IP Player - BuDweiSeR - 05.01.2018

Код:
ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Registrar", "\t{FF0000}Aprendizado\n\nNick:\n\nIP:\n\nLogin:\n\nDigite uma senha para se registrar:", string_, "Registrar", "Sair");
Код:
warning 202: number of arguments does not match definition
Estб dando esse Warning e a dialog estб bugada, O que poderia ser?

*Onde estб ' Nick: ', Aparecer nick do Player.
*Onde estб ' IP ', Aparecer IP do Player.
*Onde estб ' Login ', Aparecer a Data e Hora que ele conectou


Re: IP Player - victorara - 05.01.2018

Quote:
Originally Posted by BuDweiSeR
Посмотреть сообщение
Код:
ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Registrar", "\t{FF0000}Aprendizado\n\nNick:\n\nIP:\n\nLogin:\n\nDigite uma senha para se registrar:", string_, "Registrar", "Sair");
Код:
warning 202: number of arguments does not match definition
Estб dando esse Warning e a dialog estб bugada, O que poderia ser?

*Onde estб ' Nick: ', Aparecer nick do Player.
*Onde estб ' IP ', Aparecer IP do Player.
*Onde estб ' Login ', Aparecer a Data e Hora que ele conectou
Dialog bugada ? Trocou o valor dela ?


Re: IP Player - Marllun - 05.01.2018

PHP код:
static pName[MAX_PLAYERS][24];
public 
OnPlayerConnect(playerid)
{
    new 
IP[25], time,time1,time2,time3,time4,time5string_[158];
    
GetPlayerIp(playeridIPsizeof(IP));
    
GetPlayerName(playerid,pName[playerid],24);
    
gettime(timetime1time2);
    
getdate(time3time4time3);
    
format(string_sizeof(string_), "\t{FF0000}Aprendizado\n\nNick:%s\n\nIP:%s\n\nLogin:%02d:%02d:%02d - %02d/%02d/%02d\n\nDigite uma senha para se registrar:\n",
    
pName,IP,
    
time,
    
time1,
    
time2,
    
time3,
    
time4,
    
time5);
    
ShowPlayerDialog(playeridDIALOG_REGISTRODIALOG_STYLE_PASSWORD"Registrar"string_"Registrar""Sair");
    return 
1;




Re: IP Player - SnowBorn - 05.01.2018

Quote:

if(strcmp(cmd, "/ip", true) == 0) {
if(IsPlayerAdmin(playerid)) {
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "/ip [id]");
return 1;
}
plid = strval(tmp);
if(IsPlayerConnected(plid)){
new sstring[80];
new ip[128];
new pname[MAX_PLAYER_NAME];
GetPlayerIp(plid,ip,12;
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(sstring, sizeof(sstring), "-| %s (ID: %d) IP: %s |-", pname,plid,ip);
SendClientMessage(playerid,0x0080FFAA, sstring);
}else{
SendClientMessage(playerid, Vermelho, " | ERRO | ID invбlido");
return 1;
}
}
return 1;
}

Eu uso esse in-game testa ai


Re: IP Player - BuDweiSeR - 06.01.2018

PHP код:
public OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid)
{
    if(
playertextid == Login1[1][playerid])
    {
        new 
IP[25], time[6], string_[160];
        
GetPlayerIp(playeridIPsizeof(IP));
        
GetPlayerName(playeridpName[playerid],24);
        
gettime(time[0], time[1], time[2]);
        
getdate(time[3], time[4], time[5]);
        
format(string_sizeof(string_), "\t{FF0000}Aprendizado\n\n{FFFFFF}Nick:%s\n\nIP:%s\n\nLogin:%02d:%02d:%02d - %02d/%02d/%02d\n\nDigite uma senha para se registrar:\n",
        
pName,IP,
        
time[0],
        
time[1],
        
time[2],
        
time[3],
        
time[4],
        
time[5]);
        
ShowPlayerDialog(playeridDIALOG_REGISTRODIALOG_STYLE_PASSWORD"Registrar"string_"Registrar""Sair"); 
A Dialog estб bugada, Aparece apenas, " Aprendizado , Nick: H "