SA-MP Forums Archive
Definition of SendAdminMessage - 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: Definition of SendAdminMessage (/showthread.php?tid=623442)



Definition of SendAdminMessage - RyderX - 01.12.2016

Hello all SA-MP Pawners and Scripter, i've a little question that i need to get the #definition of SendAdminMessage.

For example:
PHP код:
SendAdminMessage(COLOR_REDstring); 
Error:
Код HTML:
Undefined Symbole: SendAdminMessage.



Re: Definition of SendAdminMessage - Hunud - 01.12.2016

Create a stock for it which will send a message only to administrators!


Re: Definition of SendAdminMessage - NeXoR - 01.12.2016

Create a function named SendAdminMessage where you loop through your admins and send them a message


Re: Definition of SendAdminMessage - RyderX - 01.12.2016

But a Function like, Can get an example?


Re: Definition of SendAdminMessage - NeXoR - 01.12.2016

SendAdminMessage(color, string[])
{
for new I = 0, j = GetPlayerPoolSize(); I < j; I++;
If isplayeradmin send client message
}

(Writing from my iPad, sorry)


Re: Definition of SendAdminMessage - Isolated - 01.12.2016

pawn Код:
stock SendAdminMessage(color, string[]) {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) && IsPlayerAdmin(i)) {
            SendClientMessage(i, color, string);
        }
    }
}
May not be the best example, but you get the idea, similar to above.


Re: Definition of SendAdminMessage - RyderX - 01.12.2016

Thanks For your help both of you!


Re: Definition of SendAdminMessage - MattMaximum - 08.12.2016

I am using foreach.
stock submitToAdmins(color, string)
{
foreach(Player, i)
{
If(PlayerInfo[i][pAdmin] >= 1) SendClientMessage(i, color, string);
}
}
Something like that.Wrote it on phone.