30.03.2013, 07:02
Quote:
|
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 pawn Код:
pawn Код:
|
pawn Код:
CMD:ip(playerid,params[])
{
new tmp[256],new idx=0;
if(gPlayerInfo[playerid][Level] >= 1)
{
if(!strlen(params)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Usage: /ip [PlayerID]"), SendClientMessage(playerid, COLOR_ORANGE, "Function: Will see Ip of specified player");
tmp=strtok(params,idx);
new player1 = strval(tmp);
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)
{
new tmp3[50];
GetPlayerIp(player1,tmp3,50);
format(string,sizeof(string),"PlayerName: %s | IP: %s", pName, tmp3);
SendClientMessage(playerid,COLOR_YELLOW,string);
}
else return ErrorMessages(playerid, 2);
}
else return ErrorMessages(playerid, 1);
}


