05.01.2018, 15:20
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?
Alguйm poderia me ensinar?
public OnPlayerConnect(playerid)
{
new IP[25], time[6], string_[128];
GetPlayerIp(playerid, IP, sizeof(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(playerid, 666, DIALOG_STYLE_MSGBOX, "sei la", string_, "bah", "fodase");
return 1;
}
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
Код:
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 *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 |
static pName[MAX_PLAYERS][24];
public OnPlayerConnect(playerid)
{
new IP[25], time,time1,time2,time3,time4,time5, string_[158];
GetPlayerIp(playerid, IP, sizeof(IP));
GetPlayerName(playerid,pName[playerid],24);
gettime(time, time1, time2);
getdate(time3, time4, time3);
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(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Registrar", string_, "Registrar", "Sair");
return 1;
}
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; } |
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == Login1[1][playerid])
{
new IP[25], time[6], string_[160];
GetPlayerIp(playerid, IP, sizeof(IP));
GetPlayerName(playerid, pName[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(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Registrar", string_, "Registrar", "Sair");