30.03.2013, 06:41
i was using this command but whenever i use this the parmas are not working even i type /ip instead of /ip <id> it shows my ip not the others but when i use like /ip 1 it says the player is not connected
it's my player file
it's my player file
pawn Код:
#define PlayerFile "CAdmin/Users/%s.ini"
pawn Код:
CMD:ip(playerid,params[])
{
if(gPlayerInfo[playerid][Level] >= 1)
{
new file[100], name[MAX_PLAYER_NAME];
// new str[128];
// new PlayerName[MAX_PLAYER_NAME];
if(!strlen(params)) return
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Usage: /ip [PlayerID]") &&
SendClientMessage(playerid, COLOR_ORANGE, "Function: Will see Ip of specified player");
new player1 = strval(params);
new string[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(player1, pName, sizeof(pName));
if(gPlayerInfo[player1][Level] == MAX_ADMIN_LEVEL && gPlayerInfo[playerid][Level] != MAX_ADMIN_LEVEL)
return SendClientMessage(playerid,COLOR_RED,"ERROR: You cannot use this command on this admin");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
GetPlayerName(player1, name, sizeof(name));
format(file, sizeof(file), PlayerFile, name);
// SendCommandToAdmins(playerid,"Ip");
new tmp3[50];
GetPlayerIp(player1,tmp3,50);
format(string,sizeof(string),"PlayerName: %s | IP: %s", file, tmp3);
return SendClientMessage(playerid,COLOR_YELLOW,string);
}
else return ErrorMessages(playerid, 2);
}
else return ErrorMessages(playerid, 1);
}