17.01.2016, 14:28
Quote:
SendClientMessage(0xFFFFFFAA,string);
Here is your problem https://sampwiki.blast.hk/wiki/SendClientMessage Syntax is SendClientMessage(playerid, color, const message[]); And you don't have any playerid to send the client msg to, other than that your code works just fine. |
But recently I've tried to remake the message system for only admins, whoever joins, leaves or times out, a message is sent to admins, and I failed on this one too, seems like I'm in need of your help.
So this doesn't work.
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason)
{
if (IsPlayerConnected(i))
{
if (IsPlayerAdmin(i))
case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname);
case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname);
case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pname);
}
SendClientMessage(playerid, -1, params);
return 1;
}
EDIT: I'm researching on ****** and everything I find useful like a 1000 times to make it work, but when I am stuck on something, I'm just posting here for help.