Vezi mesaje fără răspuns | Vezi subiecte active Acum este Sâm Iun 06, 2026 6:13 pm



Răspunde la subiect  [ 1 mesaj ] 
tutorial Colorare Comenzi folosind Stock 
Autor Mesaj
Membru
Avatar utilizator

Membru din: Lun Aug 24, 2015 2:50 pm
Mesaje: 1407
Localitate: Romania
Skype ID: Nu am!
Yahoo ID: laurentiuciorogar@ya
Server Preferat: Zm.Playcs.ro
Detinator Server: Fost Owner Respawn.
Folosim un plugin simplu de restart..
Cod:
#include <amxmodx>
#include <amxmisc>
 
public plugin_init()
{
 register_plugin("Restart", "1.0", "C")
 
 register_concmd("say .restart","rr",ADMIN_KICK,"-Da Restart")
 
}
public rr(){
 client_print(0, print_chat, "Live Live Live")
 client_print(0, print_chat, "Live Live Live")
 client_print(0, print_chat, "Live Live Live")
 client_print(0, print_chat, "Live Live Live")
 client_print(0, print_chat, "Live Live Live")
 client_print(0, print_chat, "Live Live Live")
 
 server_cmd("sv_restart 1");
 return PLUGIN_HANDLED;
}

Adaugam jos in sma Codul asta:
Cod:
stock chat_color(const id, const input[], any:...)
{
 new count = 1, players[32]
 static msg[191]
 vformat(msg, 190, input, 3)
 
 replace_all(msg, 190, "!g", "^4")
 replace_all(msg, 190, "!y", "^1")
 replace_all(msg, 190, "!team", "^3")
 
 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();
   }
  }
 }
}
 


Trebuie sa avem asa:

Cod:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
 register_plugin("Restart", "1.0", "C")
 
 register_concmd("say /restart","rr5",ADMIN_KICK,"-Da Restart")
       
}
public rr5(){
 client_print(0, print_chat, "gLive Live Live")
 client_print(0, print_chat, "Live Live Live")
 client_print(0, print_chat, "Live Live Live")
 client_print(0, print_chat, "Live Live Live")
 client_print(0, print_chat, "Live Live Live")
 client_print(0, print_chat, "Live Live Live")
 
 
 server_cmd("sv_restart 1");
 return PLUGIN_HANDLED;
}
stock chat_color(const id, const input[], any:...)
{
 new count = 1, players[32]
 static msg[191]
 vformat(msg, 190, input, 3)
 
 replace_all(msg, 190, "!g", "^4")
 replace_all(msg, 190, "!y", "^1")
 replace_all(msg, 190, "!team", "^3")
 
 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();
   }
  }
 }
}

In loc de client_print(0, print_chat, " punem chat_color(0,"

Culori
!g este Verde
!y este Galben
!team este Rosu la Terro si Albastru la CT

Si uitati un exemplu:

Cod:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
 register_plugin("Restart", "1.0", "C")
 
 register_concmd("say /restart","rr5",ADMIN_KICK,"-Da Restart")
       
}
public rr5(){
 chat_color(0,"!gLive Live Live")
 chat_color(0,"!yLive Live Live")
 chat_color(0,"!teamLive Live Live")
 chat_color(0,"!gLive Live Live")
 chat_color(0,"!yLive Live Live")
 chat_color(0,"!teamLive Live Live")
 
 server_cmd("sv_restart 1");
 return PLUGIN_HANDLED;
}
stock chat_color(const id, const input[], any:...)
{
 new count = 1, players[32]
 static msg[191]
 vformat(msg, 190, input, 3)
 
 replace_all(msg, 190, "!g", "^4")
 replace_all(msg, 190, "!y", "^1")
 replace_all(msg, 190, "!team", "^3")
 
 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();
   }
  }
 }
}

_________________
Imagine


Joi Dec 17, 2015 1:52 pm
Profil Trimiteţi mesaj privat E-mail YIM
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 2 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