SA-MP Forums Archive
admin and player - 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: admin and player (/showthread.php?tid=635652)



admin and player - JuzDoiT - 11.06.2017

hello , can someone help me to settings , Join Message For My Server?

here is onplayerconnect message

PHP код:
    new connectstr[128];
    
format(connectstrsizeof(connectstr), "* %s (%d) Has Joined The Server.",pNick(playerid),playerid);
    
SendClientMessageToAll(COLOR_DEADconnectstr); 
i want to edit it ,, if online players are admins ,, then show his ip addres if they are not show the same message

PHP код:
    new connectstr[128];
    
format(connectstrsizeof(connectstr), "* %s (%d) Has Joined The Server -  IP: %s.",pNick(playerid),playerid,ip);
    
SendClientMessageToAll(COLOR_DEADconnectstr); 
here is my admin settings

Quote:

if(PlayerInfo[playerid][pAdmin] < 1)
{

//add code
}




Re: admin and player - FailerZ - 11.06.2017

Код:
new connectstr[128], ip[16];
    GetPlayerIp(playerid, ip, sizeof(ip)) // Assign the IP to the ip string variable
    format(connectstr, sizeof(connectstr), "* %s (%d) Has Joined The Server -  IP: %s.",pNick(playerid),playerid,ip); 
    for(new i; i <= MAX_PLAYERS; i++) //Loop through all players
    {
    	if(PlayerInfo[i][pAdmin] >= 1) SendClientMessage(i, COLOR_DEAD, connectstr);
    }



Re: admin and player - JuzDoiT - 11.06.2017

: error 001: expected token: ";", but found "-identifier-"

on this line

PHP код:
    format(connectstrsizeof(connectstr), "* %s (%d) Has Joined The Server -  IP: %s.",pNick(playerid),playerid,ip); 



Re: admin and player - FailerZ - 11.06.2017

my bad add ; at the end of GetPlayerIp like this
Код:
GetPlayerIp(playerid, ip, sizeof(ip));
Here the total code if you didn't get what I mean
PHP код:
    new connectstr[128], ip[16];
    
GetPlayerIp(playeridipsizeof(ip)); // Assign the IP to the ip string variable
    
format(connectstrsizeof(connectstr), "* %s (%d) Has Joined The Server -  IP: %s.",pNick(playerid),playerid,ip); 
    for(new 
i<= MAX_PLAYERSi++) //Loop through all players
    
{
        if(
PlayerInfo[i][pAdmin] >= 1SendClientMessage(iCOLOR_DEADconnectstr);
    }