GetPlayerIp...
#1

It's supposed to show the connecting players ip for admins lvl 1 and higher... but nothing is happening but no errors or warnings..
Please help?

Код:
public OnPlayerConnect(playerid)
{
  new dialog[128],string[128],ip[16],name[MAX_PLAYER_NAME];
    format(string, 35, Player_File, GetName(playerid));

    if(!INI_Exists(string))
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Name "COL_WHITE"%s "COL_YELLOW"isn't registered\n\nPlease typepassword", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_RED"Welcome on my server", dialog, "Register", "Exit");
    }
    else
    {
        format(dialog, sizeof(dialog),""COL_YELLOW"Name "COL_WHITE"%s "COL_YELLOW"is registered\n\nPlease login", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""COL_YELLOW"Welcome on my server",dialog, "Login", "Exit");
 }
 SetPVarInt(playerid, "Join", 1);

 if(P_Data[playerid][pAdmin] >= 1)
 {
 GetPlayerName(playerid,name,sizeof(name));
 GetPlayerIp(playerid,ip,sizeof(ip));
 format(string, 150, "%s has Connected with ip: %s.", name, ip);
 SCMToAll(COLOR_RED,string);
 }
 return 1;
 }
Reply
#2

nub we fixed it.
Reply
#3

Yea ik

EDIT: no rly its showing for all players not only admins...
Reply
#4

Quote:
Originally Posted by mrsamp
Посмотреть сообщение
Yea ik

EDIT: no rly its showing for all players not only admins...
we fixed it again xD

stay on skype!!
Reply
#5

It's not even showing ip for admins now...
Reply
#6

....... You are checking if the connected player is an admin, then checking his IP and sending it to EVERYONE...

Код:
new ip[16],name[20],string[150];
GetPlayerIp(playerid, ip, sizeof(ip));
GetPlayerName(playerid,name,sizeof(name));
format(string, 150, "%s has Connected with ip: %s.", name, ip);

for(new i=0;i<MAX_PLAYERS;i++)
{
  if(P_Data[i][pAdmin] >= 1)
 {
SCM(i,COLOR_RED,string);
 }
}
Reply
#7

Thank you it's working.

P.S I'm new. :P
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)