SA-MP Forums Archive
message to admins (fs help) - 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: message to admins (fs help) (/showthread.php?tid=619723)



message to admins (fs help) - Oshery - 21.10.2016

http://forum.sa-mp.com/showthread.ph...94#post3785894

i want an help with making it to admins only, is it possible? can you please help me, i dont exactly know how can i do that..


Re: message to admins (fs help) - ActionTanki91 - 21.10.2016

Код:
stock SendToAdmins(color, message[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, color, message);
        }
    }
    return 1;
}



Re: message to admins (fs help) - Knowinne - 21.10.2016

I don't know what are you saying but maybe you mean a MessageToAdmins. Here it is:

Код:
forward MessageToAdmins(color,const string[]);
public MessageToAdmins(color,const string[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][Level] >= 1) SendClientMessage(i, color, string);
	}
	return 1;
}
Here's an Example how to do it with string a message to admins..


Код:
new string[256];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pname));
format(string,sizeof(string), "Hello, i'm Very good player how are you ? I'm also good ! ~by %s.", pName );
MessageToAdmins(COLOR_ORANGE,string);
That's it !


Just a simple message.