AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] How to put color into the .sma plugin? (https://forums.alliedmods.net/showthread.php?t=252371)

NovinhoFDR 12-01-2014 10:08

[HELP] How to put color into the .sma plugin?
 
[AJUDA] Como colcoar cor dentro do plugin .sma?

Olá sou NovinhoFDR. Estou começando agora em Plugins.

Queria colocar cor dentro do plugin .sma.

Exemplo:

(verde)[MFG] (amarelo)Seu ping não pode passar de %d

Alguem pode ajudar?

Obrigado.

YamiKaitou 12-01-2014 10:22

Re: [AJUDA] Como colcoar cor dentro do plugin .sma?
 
In English

NovinhoFDR 12-01-2014 11:34

Re: [AJUDA] Como colcoar cor dentro do plugin .sma?
 
Quote:

Originally Posted by YamiKaitou (Post 2230117)

[HELP] How to put color into the .sma plugin?

Hello am NovinhoFDR. I'm starting now in Plugins.

Wanted to put color into the .sma plugin.

example:

(green) [MFG] (yellow) Your ping can not exceed% d

Can anyone help?

Thank you.

I used Google Translate. I do not know English = D

wickedd 12-02-2014 18:02

Re: [HELP] How to put color into the .sma plugin?
 
Search colorchat and chatcolor. If you are using AMXX 1.8.3 read this.

popeye10 12-03-2014 00:23

Re: [HELP] How to put color into the .sma plugin?
 
:)

PHP Code:

client_print_color(idprint_chat"!g[MFG] !nYour ping can not exceed !t%d"); 

PHP Code:

!green color
!normal color
!team color 

and put this code end of the plugin source code.

PHP Code:

stock client_print_color(idtype, const text[], any:...)
{
 if(
type == print_chat)
 {
  new 
g_iMsgidSayText;
  
g_iMsgidSayText get_user_msgid("SayText");

  new 
szMsg[191], iPlayers[32], iCount 1;
  
vformat(szMsgcharsmax(szMsg), text3);

  
replace_all(szMsgcharsmax(szMsg), "!g","^x04");
  
replace_all(szMsgcharsmax(szMsg), "!n","^x01");
  
replace_all(szMsgcharsmax(szMsg), "!t","^x03");

  if(
id)
   
iPlayers[0] = id;
  else
   
get_players(iPlayersiCount"ch");

  for(new 
iCount i++)
  {
   if(!
is_user_connected(iPlayers[i]))
    continue;
   
   
message_begin(MSG_ONE_UNRELIABLEg_iMsgidSayText_iPlayers[i]);
   
write_byte(iPlayers[i]);
   
write_string(szMsg);
   
message_end();
  }
 }



Kia 12-03-2014 01:36

Re: [HELP] How to put color into the .sma plugin?
 
Quote:

Originally Posted by popeye10 (Post 2230645)
:)

PHP Code:

client_print_color(idprint_chat"!g[MFG] !nYour ping can not exceed !t%d"); 

PHP Code:

!green color
!normal color
!team color 

and put this code end of the plugin source code.

PHP Code:

stock client_print_color(idtype, const text[], any:...)
{
 if(
type == print_chat)
 {
  new 
g_iMsgidSayText;
  
g_iMsgidSayText get_user_msgid("SayText");

  new 
szMsg[191], iPlayers[32], iCount 1;
  
vformat(szMsgcharsmax(szMsg), text3);

  
replace_all(szMsgcharsmax(szMsg), "!g","^x04");
  
replace_all(szMsgcharsmax(szMsg), "!n","^x01");
  
replace_all(szMsgcharsmax(szMsg), "!t","^x03");

  if(
id)
   
iPlayers[0] = id;
  else
   
get_players(iPlayersiCount"ch");

  for(new 
iCount i++)
  {
   if(!
is_user_connected(iPlayers[i]))
    continue;
   
   
message_begin(MSG_ONE_UNRELIABLEg_iMsgidSayText_iPlayers[i]);
   
write_byte(iPlayers[i]);
   
write_string(szMsg);
   
message_end();
  }
 }



Or use AMXX 1.8.3


All times are GMT -4. The time now is 15:28.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.