join messages -
[SF]RobMob - 10.03.2010
right now i have it when a player joins it shows in chat i would like for it to show the ip to admins as well could i get help with this and my /info command is buged a bit it dont show correct health or correct multiple ip`s
COMMAND:info(playerid,params[])
{
if(level[playerid] >= 1)
{
new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /info [playerid]");
new player1, ClientIP[20], AllClientIP[128];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerIp(player1, ClientIP, sizeof(ClientIP));
GetPlayerIp(i, AllClientIP, sizeof(AllClientIP));
new Float:health, Float:armour;
GetPlayerHealth(player1, health);
GetPlayerArmour(player1, armour);
if(!strcmp(ClientIP, AllClientIP, true))
{
new RemoteName[MAX_PLAYER_NAME], InfoString[128];
GetPlayerName(player1, RemoteName, sizeof(RemoteName));
format(InfoString,sizeof(InfoString),"Username: %s!\nMultiple IP: Yes.\nAdmin Level: %d\nCash: %d\nHealth: %d\nArmour: %d\nRank: %d", RemoteName, level[player1], GetPlayerMoney(player1), health, armour, serverrank[player1]);
ShowPlayerDialog(playerid,1432,DIALOG_STYLE_MSGBOX ,"Player Information",InfoString,"Ok","Cancel");
}
else
{
new RemoteName[MAX_PLAYER_NAME], InfoString[128];
GetPlayerName(player1, RemoteName, sizeof(RemoteName));
format(InfoString,sizeof(InfoString),"Username: %s!\nMultiple IP: No.\nAdmin Level: %d\nCash: %d\nHealth: %d\nArmour: %d\nRank: %d", RemoteName, level[player1], GetPlayerMoney(player1), health, armour, serverrank[player1]);
ShowPlayerDialog(playerid,1541,DIALOG_STYLE_MSGBOX ,"Player Information",InfoString,"Ok","Cancel");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Error: Either the player has left or there not connected.");
}
}
else
{
SendClientMessage(playerid, red, "Error: You are either not a admin or you are not a admin with the correct level.");
}
return 1;
}
Re: join messages -
[cA]Unforseen - 10.03.2010
this may help you...
Код:
GetPlayerIp(playerid)
Re: join messages -
[cA]Unforseen - 10.03.2010
Ohhh... for admins try this one
Код:
if (IsPlayerAdmin(playerid))
{
GetPlayerIp(playerid...
}
it should help you
Re: join messages -
[SF]RobMob - 10.03.2010
i know about the get playerip but when i code it into my onplayerconnect i keep getting a error can i get the full code pease
Re: join messages -
Miguel - 10.03.2010
pawn Код:
public OnPlayerConnect(playerid)
{
new ip[16];
new string[51];
GetPlayerIp(playerid, ip, sizeof(ip));
format(string, sizeof(string), "A player just connected with IP: %s!", ip);
SendClientMessageToAll(COLOR, string);
return 1:
}
That's just an example.
Re: join messages -
[SF]RobMob - 10.03.2010
Quote:
Originally Posted by SAWC™
pawn Код:
public OnPlayerConnect(playerid) { new ip[16]; new string[51]; GetPlayerIp(playerid, ip, sizeof(ip)); format(string, sizeof(string), "A player just connected with IP: %s!", ip); SendClientMessageToAll(COLOR, string); return 1: }
That's just an example.
|
Thanks alot
Re: join messages -
[SF]RobMob - 10.03.2010
i tryed that and couldnt get it to work so I made my own and it still dont work anyone see a problem here ?
if (level[playerid] >= 1)
{
new ip[16];
new OwnerMessage[128];
GetPlayerIp(playerid, ip, sizeof(ip));
format(OwnerMessage,sizeof(OwnerMessage),"[ip]: %s just loged in with ip %s",pname,ip);
MessageToOwners(COLOR_GREY, OwnerMessage);
return 1;
}
Re: join messages -
Miguel - 10.03.2010
pawn Код:
if (level[playerid] >= 1)
{
new ip[16];
new pname[MAX_PLAYER_NAME]; // here
new OwnerMessage[128];
GetPlayerIp(playerid, ip, sizeof(ip));
GetPlayerName(playerid, pname, sizeof(pname)); // here
format(OwnerMessage,sizeof(OwnerMessage),"[ip]: %s just loged in with ip %s",pname,ip);
MessageToOwners(COLOR_GREY, OwnerMessage);
return 1;
}
Re: join messages -
[SF]RobMob - 10.03.2010
Quote:
Originally Posted by SAWC™
pawn Код:
if (level[playerid] >= 1) { new ip[16]; new pname[MAX_PLAYER_NAME]; // here new OwnerMessage[128]; GetPlayerIp(playerid, ip, sizeof(ip)); GetPlayerName(playerid, pname, sizeof(pname)); // here format(OwnerMessage,sizeof(OwnerMessage),"[ip]: %s just loged in with ip %s",pname,ip); MessageToOwners(COLOR_GREY, OwnerMessage); return 1; }
|
Thanks tested and worked now for the info command ...