SA-MP Forums Archive
How to text to all Leader - 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: How to text to all Leader (/showthread.php?tid=677079)



How to text to all Leader - supermember - 29.06.2020

I am Admin, If i want to send my message to Leader all faction. How to make it ?

If I type /msgtoleader <text>
and I want send to... all Leader who's online!

Code:
PlayerInfo[i][pLeader]
How to make it ?

Thank you!!


Re: How to text to all Leader - xRadical3 - 29.06.2020

pawn Code:
CMD:msgtoleaders(playerid, cmdtext[])
{
    new text[144];
    if(sscanf(cmdtext, "s[144]", text)) return SendClientMessage(playerid, -1, "/msgtoleaders <text>");
    foreach(new i : Player)
    {
        if( PlayerInfo[i][pLeader] == true) SendClientMessage(i, -1, text);
    }
    return 1;
}



Re: How to text to all Leader - supermember - 29.06.2020

Ohh thank you, xRadical3 ..
thanks bro!

what 's "s[144]" ??


Re: How to text to all Leader - DRIFT_HUNTER - 29.06.2020

Quote:
Originally Posted by supermember
View Post
Ohh thank you, xRadical3 ..
thanks bro!

what 's "s[144]" ??
That is a SSCANF parameter, it just tell's that argument should be a string that is 144 characters long. 144 is the maximum text input/output in samp.


Re: How to text to all Leader - Lexless - 29.06.2020

The "s" is for string and [144] is the max lenght of it.


Re: How to text to all Leader - supermember - 29.06.2020

okay thank Lexless and DRIFT_HUNTER