CMD:oipcheck(playerid, params[])
{
new playerb[32], playerbb, file[32], IP[16], string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "s", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oipcheck [playerid]");
format(file, sizeof(file), "users/%s.ini", playerb);
if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GREY, "Player name not found.");
format(PlayerInfo[playerid][pIP], 16, "%s", dini_Get(file, "IP"));
GetPlayerIp(playerid, IP, sizeof(IP));
format(string, sizeof(string), "Name: %s | IP: %s", playerbb, RPIP(playerbb));
playerb[24] = playerbb;
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
GetPlayerIp(playerid, IP, sizeof(IP));
GetPlayerIp(playerid, IP, sizeof(IP));
CMD:oipcheck(playerid, params[])
{
new playerb[32], playerbb, file[32], IP[16], string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "s", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oipcheck [playerid]");
format(file, sizeof(file), "users/%s.ini", playerb);
if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GREY, "Player name not found.");
format(PlayerInfo[playerid][pIP], 16, "%s", dini_Get(file, "IP"));
format(string, sizeof(string), "Name: %s | IP: %s", playerbb, PlayerInfo[playerid][pIP]);
playerb[24] = playerbb;
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
|
Код:
GetPlayerIp(playerid, IP, sizeof(IP)); I don't think you even need this line of code. Код:
CMD:oipcheck(playerid, params[])
{
new playerb[32], playerbb, file[32], IP[16], string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "s", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oipcheck [playerid]");
format(file, sizeof(file), "users/%s.ini", playerb);
if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GREY, "Player name not found.");
format(PlayerInfo[playerid][pIP], 16, "%s", dini_Get(file, "IP"));
format(string, sizeof(string), "Name: %s | IP: %s", playerbb, PlayerInfo[playerid][pIP]);
playerb[24] = playerbb;
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
|
|
Exaxtly, that's what I did.
It reads from the dini file and saves the Ip adress to PlayerInfo[playerid][pIP]. Afterwards it just prints it out. |