[Tutorial] Making Special Message system
#1

INTRODUCTION

Do you place
Код:
foreach(player, i)
{
  if(PlayerInfo[playerid][pHelper] == 1)
   {

    ...bla bla
   }
}
at each special message command in your server? well, there is another easy way to do it and i will teach you how to.i know, most of Scripters here knows already what i am going to tell here, but this is not for them, its for New Scripters..

HOW TO DO IT?

Step 1.


Firstly, Decide for what you want to create it?for admins? or for Helpers? or some special cases players??
here i will give you Helper as example.

PHP код:
//put this with your other forwards
forward SendHelperMessage(colorstring[]); 
Step 2
.

PHP код:
//Now put this with your public call backs
public SendHelperMessage(colorstring[])
{
    foreach(
Playeri)
    {
            if(
PlayerInfo[i][pAdmin] >= || PlayerInfo[i][pHelper] >= 1)
            {
                
SendClientMessage(icolorstring); // Here you can use your own color variable too or direct color code. if you do add direct color code, then no need to define color in public.
            
}
    }

Step 3
.

PHP код:
// Finally Use that in your commands so each time you dont have to write foreach loop.
CMD:helpme(playeridparams[])
{
   
// bla code
  
SendHelperMessage(COLOR_HELP"%s"params);
 return 
1;

Isnt that easy now? you dont have to write foreach commands each time for same chats. you can create it for anything like if player is in event, or is VIP, or is in a Faction etc..

This was my first official tutorial here. i'll now add more tutorials to help new ones now.

Hope this helped some new scripter.. XD
Reply


Messages In This Thread
Making Special Message system - by GTLS - 07.06.2016, 05:15
Re: Making Special Message system - by Vince - 07.06.2016, 08:43
Re: Making Special Message system - by PrO.GameR - 07.06.2016, 22:33
Re: Making Special Message system - by Crystallize - 07.06.2016, 22:50
Re: Making Special Message system - by zSuYaNw - 09.06.2016, 13:49
Re: Making Special Message system - by Luicy. - 09.06.2016, 14:32
Re: Making Special Message system - by HydraHumza - 09.06.2016, 14:33
Re: Making Special Message system - by GeorgeMcReary - 14.06.2016, 10:16

Forum Jump:


Users browsing this thread: 1 Guest(s)