Vezi mesaje fără răspuns | Vezi subiecte active Acum este Lun Iul 27, 2026 12:51 pm



Răspunde la subiect  [ 1 mesaj ] 
[Tutorial] Cum colorezi o comanda 
Autor Mesaj
Membru
Avatar utilizator

Membru din: Sâm Mar 05, 2016 6:34 pm
Mesaje: 317
Yahoo ID: justforsex666
Server Preferat: Star.Playcs.ro
Avem plugin-ul acesta

Cod:
#include <amxmodx>
#include <amxmisc>

#define ACCESS ADMIN_SLAY

public plugin_init()
{
   register_plugin("Restart","2.0","Alka")
   register_clcmd("say /restart","say_restart",ACCESS)
   register_clcmd("say_team /restart","say_restart",ACCESS)
}

public say_restart(id)
{
   if(!(get_user_flags(id) & ACCESS))
      return
 
      server_cmd("sv_restart 1")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
   
}



Adaugam la sfarsit asta


Cod:
stock chat_color(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[320]
   vformat(msg, 190, input, 3)
   replace_all(msg, 190, "!g", "^4")
   replace_all(msg, 190, "!n", "^1")
   replace_all(msg, 190, "!t", "^3")
   replace_all(msg, 190, "!t2", "^0")
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
      for (new i = 0; i < count; i++)
      {
         if (is_user_connected(players[i]))
         {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
            write_byte(players[i])
            write_string(msg)
            message_end()
         }
      }
   }
}


Acum plugin-ul arata asa

Cod:
#include <amxmodx>
#include <amxmisc>

#define ACCESS ADMIN_SLAY

public plugin_init()
{
   register_plugin("Restart","2.0","Alka")
   register_clcmd("say /restart","say_restart",ACCESS)
   register_clcmd("say_team /restart","say_restart",ACCESS)
}

public say_restart(id)
{
   if(!(get_user_flags(id) & ACCESS))
      return
 
      server_cmd("sv_restart 1")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
      client_print(0,print_chat,"[- - Restart Live - -]")
   
}
stock chat_color(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[320]
   vformat(msg, 190, input, 3)
   replace_all(msg, 190, "!g", "^4")
   replace_all(msg, 190, "!n", "^1")
   replace_all(msg, 190, "!t", "^3")
   replace_all(msg, 190, "!t2", "^0")
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
      for (new i = 0; i < count; i++)
      {
         if (is_user_connected(players[i]))
         {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
            write_byte(players[i])
            write_string(msg)
            message_end()
         }
      }
   }
}


Inlocuim

Cod:
client_print(0,print_chat,


cu

Cod:
chat_color(0,


iar plugin-ul devine

Cod:
#include <amxmodx>
#include <amxmisc>

#define ACCESS ADMIN_SLAY

public plugin_init()
{
   register_plugin("Restart","2.0","Alka")
   register_clcmd("say /restart","say_restart",ACCESS)
   register_clcmd("say_team /restart","say_restart",ACCESS)
}

public say_restart(id)
{
   if(!(get_user_flags(id) & ACCESS))
      return
 
      server_cmd("sv_restart 1")
      chat_color(0,"[- - Restart Live - -]")
      chat_color(0,"[- - Restart Live - -]")
      chat_color(0,"[- - Restart Live - -]")
      chat_color(0,"[- - Restart Live - -]")
      chat_color(0,"[- - Restart Live - -]")
      chat_color(0,"[- - Restart Live - -]")
      chat_color(0,"[- - Restart Live - -]")
   
}
stock chat_color(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[320]
   vformat(msg, 190, input, 3)
   replace_all(msg, 190, "!g", "^4")
   replace_all(msg, 190, "!n", "^1")
   replace_all(msg, 190, "!t", "^3")
   replace_all(msg, 190, "!t2", "^0")
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
      for (new i = 0; i < count; i++)
      {
         if (is_user_connected(players[i]))
         {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
            write_byte(players[i])
            write_string(msg)
            message_end()
         }
      }
   }
}



Acum regula de colorare este
!g - verde
!n - normal (culoarea chat-ului)
!t - rosu/albastru
Si in final avem

Cod:
#include <amxmodx>
#include <amxmisc>

#define ACCESS ADMIN_SLAY

public plugin_init()
{
   register_plugin("Restart","2.0","Alka")
   register_clcmd("say /restart","say_restart",ACCESS)
   register_clcmd("say_team /restart","say_restart",ACCESS)
}

public say_restart(id)
{
   if(!(get_user_flags(id) & ACCESS))
      return
 
      server_cmd("sv_restart 1")
      chat_color(0,"!t[- - Restart Live - -]")
      chat_color(0,"!t[- - Restart Live - -]")
      chat_color(0,"!t[- - Restart Live - -]")
      chat_color(0,"!t[- - Restart Live - -]")
      chat_color(0,"!t[- - Restart Live - -]")
      chat_color(0,"!t[- - Restart Live - -]")
      chat_color(0,"!t[- - Restart Live - -]")
   
}
stock chat_color(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[320]
   vformat(msg, 190, input, 3)
   replace_all(msg, 190, "!g", "^4")
   replace_all(msg, 190, "!n", "^1")
   replace_all(msg, 190, "!t", "^3")
   replace_all(msg, 190, "!t2", "^0")
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
      for (new i = 0; i < count; i++)
      {
         if (is_user_connected(players[i]))
         {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
            write_byte(players[i])
            write_string(msg)
            message_end()
         }
      }
   }
}

_________________
Merg Ushor Pe Harta
Apasand Pe Shift
Inamicul Poarta
Kalashul In Lift
Catacomba-i Goala
Asteptand Un Pas
Hedul Ca Sa-l Dau
inDirect Prin Nas
Teroristu-ncarca
Dar Eu Il Aud
Si Ii Dau Aproape
Drect In Neavut

Respect and Esteem


Mie Apr 20, 2016 5:03 pm
Profil Trimiteţi mesaj privat E-mail
Afişează mesajele din ultimele:  Sortează după  
Răspunde la subiect   [ 1 mesaj ] 

Cine este conectat

Utilizatorii ce navighează pe acest forum: Niciun utilizator înregistrat şi 3 vizitatori


Nu puteţi scrie subiecte noi în acest forum
Nu puteţi răspunde subiectelor din acest forum
Nu puteţi modifica mesajele dumneavoastră în acest forum
Nu puteţi şterge mesajele dumneavoastră în acest forum
Nu puteţi publica fişiere ataşate în acest forum

Căutare după:
Mergi la:  
Furnizat de phpBB® Forum Software © phpBB Group
Designed by ST Software.
Translation/Traducere: phpBB România
phpBB SEO