I do not see the ip
#3

Quote:
Originally Posted by greentarch
Посмотреть сообщение
Erm. I don't really understand that code (a little weird, sorry I have to call that)
Why..? You probably ask that.
It's because your checking if someone is an administrator, you are sending a message to all players

I made 2 versions for you, (which should work; on theory)
First version is the message, is sent to all players
pawn Код:
public OnPlayerConnect(playerid) {
    new
        pIP[17],
        pName[24],
        szStr[128];
    GetPlayerName(playerid, pName, sizeof pName);
    GetPlayerIp(playerid, pIP, sizeof pIP);
    format(szStr, sizeof (szStr), "%s has joined the server. (IP: %s)", pName, pIP);
    SendClientMessageToAll(-1, szStr);
    return 1;
}
Second version is the message, is sent to all online RCON administrators.
pawn Код:
public OnPlayerConnect(playerid) {
    new
        pIP[17],
        pName[24],
        szStr[128];
    GetPlayerName(playerid, pName, sizeof pName);
    GetPlayerIp(playerid, pIP, sizeof pIP);
    format(szStr, sizeof (szStr), "%s has joined the server. (IP: %s)", pName, pIP);
    for (new i, j = GetMaxPlayers(); i < j; ++ i) {
        if (!IsPlayerConnected(i))
            continue;
        if (IsPlayerAdmin(i)) {
            SendClientMessage(i, -1, szStr);
        }
    }
    return 1;
}
Sorry if it didn't helped..
It helped thank you.
Reply


Messages In This Thread
I do not see the ip - by TuNiSiAnO1 - 02.07.2014, 17:25
Re: I do not see the ip - by greentarch - 02.07.2014, 17:33
Re: I do not see the ip - by TuNiSiAnO1 - 02.07.2014, 21:36

Forum Jump:


Users browsing this thread: 1 Guest(s)