IP before Disconnect
#1

I would like if a player Dissconect (/q) that his IP in chat written is

also:

Player disconnect (IP: 123.123.2.2)

how can i make this?
Reply
#2

Deleted
Reply
#3

create an array in your scripts top:
pawn Код:
new PlayerIP[MAX_PLAYERS][16];
and then, OnPlayerConnect, get his IP and save it to the string array.
its not possible to obtain a players IP when /q-ing, (maybe coz the queing takes too long?), so the arrayed string trick will solve your problem.
Reply
#4

Player Disconnect IP 255.255.255.255 comes now :S
Reply
#5

pawn Код:
new IP[MAX_PLAYERS][16];
 
public OnPlayerConnect(playerid)
{
    GetPlayerIp(playerid, IP[playerid], sizeof(IP[playerid]));
    return 1;
}
 
public OnPlayerDisconnect(playerid, reason)
{
    new str[25];
    format(str, sizeof str, "IP: %s", IP[playerid]);
    SendClientMessageToAll(-1, str);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)