When player connect his aka [rep+1]
#1

Hi Friends :P
Iam using LuxAdmin, and i try to use lux admin connect messages i saw this messages in script, when player connect [and ur loged as admin] tells his ip and his name.. etc..
but my lux connect msgs dont work
so i need some idea or script or tutorial if u gotta for RCON only, when player connect tels his ip and maybe name
REPPING!
Thanks <3
Reply
#2

someone knows? |
Reply
#3

You need to put a SendClientMessage to OnPlayerConnect
And for ip,you can get it like this.
https://sampwiki.blast.hk/wiki/GetPlayerIp
Reply
#4

Код:
public OnPlayerConnect(playerid)
{
    new pName[24],PIP[16],String[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerIp(playerid,PIP, sizeof(PIP));

    format(string, sizeof(string),"%s has joined the server ip: (%s)",pName,PIP)

    for (new i = 0; i <  MAX_SERVER_PLAYERS; i++)
   {

         if(IsPlayerAdmin(i)) SendClientMessage(i, 0xDEEE20FF, string);
    }


    return 1;
}
Reply
#5

Quote:
Originally Posted by Cadetz
Посмотреть сообщение
Код:
public OnPlayerConnect(playerid)
{
    new pName[24],PIP[16],String[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerIp(playerid,PIP, sizeof(PIP));

    format(string, sizeof(string),"%s has joined the server ip: (%s)",pName,PIP)

    for (new i = 0; i <  MAX_SERVER_PLAYERS; i++)
   {

         if(IsPlayerAdmin(i)) SendClientMessage(i, 0xDEEE20FF, string);
    }


    return 1;
}
Shows errorZ :S
anyone?
Reply
#6

replace under connect messages
pawn Код:
//==============================================================================
// Connect Messages
//==============================================================================
    if(ServerInfo[ConnectMessages] == 1)
    {
        new pAKA[256];
        pAKA = dini_Get("LuxAdmin/Config/aka.txt",tmp3);
        if (strlen(pAKA) < 3)
        format(str,sizeof(str),"* Player %s (Id:%d) has joined the server", PlayerName,playerid);
        else if (!strcmp(pAKA,PlayerName,true))
        format(str,sizeof(str),"* Player %s (Id:%d) has joined the server", PlayerName,playerid);
        else format(str,sizeof(str),"Player %s (Id:%d) has joined the server (Aka: %s)",PlayerName,playerid,pAKA);

        for(new i = 0; i < MAX_PLAYERS; i++)
        if(IsPlayerConnected(i) && playerid != i)
        {
        if(IsPlayerAdmin(i))
        SendClientMessage(i,grey,str);
        else
        {
        format(string,sizeof(string),"* Player %s (Id:%d) has joined the server", PlayerName, playerid);
        SendClientMessage(i,grey,string);
        }
        }
    }
Reply
#7

pawn Код:
// Put is In OnPlayerConnect:
new
    istr[100],
    Nome[24],
    ip[16]
;

GetPlayerName(playerid, Nome, 24); GetPlayerIp(playerid, ip, 16).
format(istr, sizeof(istr),"%s(%i), has joined the server IP: %s", Nome, playerid, ip);

for(new i, e = GetMaxPlayers(); i != e; ++i)
{
    if(IsPlayerConnected(i) && IsPlayerAdmin(i))
    {
        SendClientMessage(playerid, -1, istr);
    }
}
Reply
#8

Quote:
Originally Posted by ProdrifterX
Посмотреть сообщение
Shows errorZ :S
anyone?

MY bad

i forgot ";" at the end of line 7

Код:
public OnPlayerConnect(playerid)
{
    new pName[24],PIP[16],String[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerIp(playerid,PIP, sizeof(PIP));

    format(string, sizeof(string),"%s has joined the server ip: (%s)",pName,PIP);

    for (new i = 0; i <  MAX_SERVER_PLAYERS; i++)
   {

         if(IsPlayerAdmin(i)) SendClientMessage(i, 0xDEEE20FF, string);
    }


    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)