Help With Getting An Ip
#1

how can i do that if the player does not join with the ip in script his ip is banned not the name
Reply
#2

what do you mean?
Reply
#3

i mean i got an static ip (that never changes) so i want in script that no one else can join with my name i mean no one can join it without my ip
Reply
#4

you mean the function for banning player's ip?
Reply
#5

example a player join with ip 136.545.448.455 and the ip for that nick name in script is 145.145.145.145(just example) his ip 136.545.448.455 (only ip not name) gets banned
Reply
#6

to ban player's ip,not the user
pawn Код:
new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
format(string, sizeof(string),"banip %s", ip);
SendRconCommand(string);
SendRconCommand("reloadbans");
Reply
#7

just put a password on the server.
Reply
#8

and how to get that which ip is not = to or == the ip in script
Reply
#9

OnPlayerConnect
pawn Код:
new ip[16], string[128];
if(!GetPlayerIp(playerid, ip, sizeof(ip)) == 127.0.0.1)
{
     format(string, sizeof(string),"banip %s", ip);
     SendRconCommand(string);
     SendRconCommand("reloadbans");
}
Try?
Reply
#10

pawn Код:
// OnPlayerConnect:
new
    szName[MAX_PLAYER_NAME],
    szIP[16];

GetPlayerName(playerid, szName, MAX_PLAYER_NAME);
GetPlayerIP(playerid, szIP, 16);
if (!strcmp(szName, "AroseKhanNaizi", true, MAX_PLAYER_NAME) && strcmp(szIP, "145.145.145.145"))
{
    // player's name is AroseKhanNaizi and the IP is not the one from the script..
    // do your code..
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)