SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/06/2020, 10:06 AM   #1
supermember
Big Clucker
 
Join Date: May 2012
Posts: 95
Reputation: 0
Default How to text to all Leader

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!!
supermember is offline   Reply With Quote
Old 29/06/2020, 10:50 AM   #2
xRadical3
Gangsta
 
Join Date: May 2017
Location: Iran
Posts: 630
Reputation: 47
Default Re: How to text to all Leader

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;
}
xRadical3 is online now   Reply With Quote
Old 29/06/2020, 12:01 PM   #3
supermember
Big Clucker
 
Join Date: May 2012
Posts: 95
Reputation: 0
Default Re: How to text to all Leader

Ohh thank you, xRadical3 ..
thanks bro!

what 's "s[144]" ??
supermember is offline   Reply With Quote
Old 29/06/2020, 12:18 PM   #4
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,150
Reputation: 215
Default Re: How to text to all Leader

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.
DRIFT_HUNTER is offline   Reply With Quote
Old 29/06/2020, 12:37 PM   #5
Lexless
Little Clucker
 
Join Date: May 2020
Posts: 38
Reputation: 14
Default Re: How to text to all Leader

The "s" is for string and [144] is the max lenght of it.
Lexless is offline   Reply With Quote
Old 29/06/2020, 06:00 PM   #6
supermember
Big Clucker
 
Join Date: May 2012
Posts: 95
Reputation: 0
Default Re: How to text to all Leader

okay thank Lexless and DRIFT_HUNTER
supermember is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
check who's leader (only leader) zowzow Scripting Help 1 28/04/2020 05:43 PM
Leader set... Scrillex Scripting Help 1 04/01/2014 05:23 PM
leader cmd Dw.UsHer Scripting Help 3 13/03/2012 08:14 PM
Leader name Qur Scripting Help 8 19/11/2011 08:04 AM
Leader help JoeDaDude Help Archive 1 10/05/2009 12:58 PM


All times are GMT. The time now is 11:54 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.