30.03.2018, 05:50
Code:
CMD:ipcheck(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!"); if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty."); new string[128], giveplayerid; if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ipcheck [playerid/partofname]"); if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Player not connected!"); if(IsPlayerConnected(giveplayerid)) { new playerip[32], country[64], city[64]; GetPlayerIp(giveplayerid, playerip, sizeof(playerip)); GetIPCountry(playerip, country, 64); GetIPCity(playerip, city, 64); format(string, sizeof(string), "ID: %d - Name: %s - IP: %s - Country: %s - City: %s", giveplayerid, GetPlayerNameEx(giveplayerid), playerip, country, city); SendClientMessage(playerid, COLOR_WHITE, string); } return 1; }