SA-MP Forums Archive
When player connect his aka [rep+1] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: When player connect his aka [rep+1] (/showthread.php?tid=333220)



When player connect his aka [rep+1] - ProdrifterX - 10.04.2012

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


Re: When player connect his aka [rep+1] - ProdrifterX - 10.04.2012

someone knows? |


Re: When player connect his aka [rep+1] - TzAkS. - 10.04.2012

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


Re: When player connect his aka [rep+1] - Cadetz - 10.04.2012

Код:
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;
}



Re: When player connect his aka [rep+1] - ProdrifterX - 11.04.2012

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?


Re: When player connect his aka [rep+1] - tyler12 - 11.04.2012

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);
        }
        }
    }



Re: When player connect his aka [rep+1] - zSuYaNw - 11.04.2012

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);
    }
}



Re: When player connect his aka [rep+1] - Cadetz - 11.04.2012

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;
}