Send Connect/Left message
#1

Well, how can i send connect/left message to admin, like SendDeathMessage?
Reply
#2

https://sampwiki.blast.hk/wiki/SendDeathMessageToPlayer

Quote:

Special icons can also be used (ICON_CONNECT and ICON_DISCONNECT).

Reply
#3

You can send the message under this callback:
https://sampwiki.blast.hk/wiki/OnPlayerDisconnect
Reply
#4

Okay thanks.
Reply
#5

The other callback you want is OnPlayerConnect.
Reply
#6

Код:
public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], string[64+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
 
    format(string, sizeof(string), "[ADMIN] %s has disconnected from the server.", name);
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		SendClientMessage(0xC4C4C4FF, string);
	}
    return 1;
}

public OnPlayerConnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], string[64+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
 
    format(string, sizeof(string), "[ADMIN] %s has joined the server.", name);
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		SendClientMessage(0xC4C4C4FF, string);
	}
    return 1;
}
Change: PlayerInfo[playerid][pAdmin] to however you save it in your script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)