admin and player
#1

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
}

Reply
#2

Код:
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);
    }
Reply
#3

: 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); 
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)