Raised This Month: $203 Target: $400
 50% 

API Scripting Help zp_color inc


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 12-12-2011 , 12:59   zp_color inc
Reply With Quote #1

How can I add color in txt ?

Example:

PHP Code:
[en]    
MENU_SAVE_MONEY Add %$. 
in %d I need add a color ( ^x04%d ^x01 ), but it's dont work.
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-13-2011 , 04:05   Re: zp_color inc
Reply With Quote #2

PHP Code:
#include <zp50_colorchat> 
All players:
PHP Code:
zp_colored_print(0"%L"LANG_PLAYER"MENU_SAVE_MONEY"iVariable
Specific Player:
PHP Code:
zp_colored_print(player"%L"player"MENU_SAVE_MONEY"iVariable
It's better to have the %d this way.

PHP Code:
^x04 %d^x01 
instead of having the green close to %d. It's more safer. I had problems with it if I stick the ^x04 together with %d.

Extra info:
  • Player's index - Uses the specific player's chosen language
  • LANG_PLAYER - Uses player's chosen language
  • LANG_SERVER - Uses server's main language
  • If you have special characters in the language file, make sure you save it as UTF-8 without BOM

To save text encoding to "UTF-8 without BOM", download & install Notepad++. Open the text document & click on Encoding on the toolbar and click "UTF-8 without BOM"

Last edited by Excalibur.007; 12-13-2011 at 04:19.
Excalibur.007 is offline
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 12-13-2011 , 10:06   Re: zp_color inc
Reply With Quote #3

In the wrong section, I wrote)
About what you wrote, I know, thank you)))

Im great plugin whit multi lang. Ex :
PHP Code:
zp_colored_print(player"%L"player"MENU_SAVE_MONEY"iVariable


In txt i have this :
PHP Code:
[en]    
MENU_SAVE_MONEY Add %$. 


And i need add color for %d :
PHP Code:
[en]    
 
MENU_SAVE_MONEY Add ^x04%d  ^x01 $. 


But it (^x04%d ^x01) dont work for me...
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
Dzhinn
Junior Member
Join Date: Sep 2011
Location: UK
Old 12-13-2011 , 12:56   Re: zp_color inc
Reply With Quote #4

Try this colored chat include file (attached below). I wanted the same thing for my self and founded this here at allied modders.

!g - green
!t - team
!y - players default chat color

I made this include some time ago (didn't meant to say that I'm the author of code, just replaced the default ZP include with Numb's one) , so can't remember is it needed the *_const.inc file (if you use ZP 5.0), but it doesn't matter. Just in case...
Attached Files
File Type: inc zp50_colorchat.inc (2.6 KB, 182 views)
File Type: inc zp50_colorchat_const.inc (314 Bytes, 225 views)

Last edited by Dzhinn; 12-13-2011 at 13:02.
Dzhinn is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 12-13-2011 , 13:11   Re: zp_color inc
Reply With Quote #5

@CHyCMyMpNk

Why don't you do it in the sma instead of txt ?
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 12-13-2011 , 13:29   Re: zp_color inc
Reply With Quote #6

2 JoKeR
I think the Multi lingual rulezzz)

2 Dzhinn
thx.
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 12-14-2011 , 00:33   Re: zp_color inc
Reply With Quote #7

Excalibur.007
in your bank it work (^x04 %d^x01) ?

Quote:
[en]

BANK_DEPOSIT = You've deposited^x04 %d^x01 ammo pack(s)

[ru]

BANK_DEPOSIT = Вы положили в банк^x04 %d^x01 аммо паков

Last edited by CHyCMyMpNk; 12-14-2011 at 00:35.
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 12-14-2011 , 03:50   Re: zp_color inc
Reply With Quote #8

he use stock from ZP
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 12-14-2011 , 04:14   Re: zp_color inc
Reply With Quote #9

I use that use he, but for me it does not work)
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 12-14-2011 , 06:29   Re: zp_color inc
Reply With Quote #10

It works on me, you have to learn how >.<
__________________
Snaker beatter is offline
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

Forum Jump


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


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode