10.03.2010, 13:28
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;
}
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;
}