[Include] BiColorNames v1.0
#1



Hello.
Give her your attention include, which allows the use of nick over the player at least 2 colors.Include replaces the standard hp / armor bars, which if necessary can off.Include detects the tag in the nick, if it is - then the tag will be the same color, and the name - in the nick other color.

All the features include:
Код:
-------------------------------------------------- ------------------------------ 
UpdateIndicator (playerid); - 3DText updates over the player 
Parameters: 
playerid - Player ID 
-------------------------------------------------- ------------------------------ 
DivideName (playerid); - updates the player's name 
Parameters: 
playerid - Player ID 
-------------------------------------------------- ------------------------------ 
SetPlayerBiColor (playerid, COLOR1, COLOR2, bool: Marker); - change color nick Player 
Parameters: 
playerid - Player ID 
COLOR1 - color tag 
COLOR2 - username color 
bool: Marker - change the color of the player on the radar? true - yes; false - no. (A marker of the player takes the color of nickname) 
-------------------------------------------------- ------------------------------ 
SetPlayerColorName (playerid, name []); - change the name of the player (replacing SetPlayerName) 
Parameters: 
playerid - Player ID 
name [] - the new name 
-------------------------------------------------- ------------------------------ 
DeathPlayer (playerid); - update the sign above the player's death 
Parameters: 
playerid - Player ID 
-------------------------------------------------- ------------------------------ 
ShowBiColorName (playerid, bool: enable); - show / hide the inscription over the player 
Parameters: 
playerid - Player ID 
bool: enable - show the inscription over the player? true - yes; false - there is no 
-------------------------------------------------- ------------------------------ 
ShowBiColorNameAll (bool: enable); - show / hide the inscription over the players 
Parameters: 
bool: enable - show the inscription over the players? true - yes; false - there is no 
-------------------------------------------------- ------------------------------ 
ShowBarsPlayer (playerid, bool: enable); - hide / show hp-bar and armour-bar over the player 
Parameters: 
playerid - Player ID 
bool: enable: true - display; false - ckryvat 
-------------------------------------------------- ------------------------------ 
ShowBarsPlayerAll (bool: enable); - hide / show hp-bar and armour-bar over the players 
Parameters: 
bool: enable: true - display; false - ckryvat 
-------------------------------------------------- ------------------------------ 
LoadBiColorNames (); - download BiColorNames 
Parameters: 
No parameters 
-------------------------------------------------- ------------------------------ 
Encoding (color); - translation feature color touch-up required for the posts Colour Embedding, by OKStyle 
Parameters: 
color - the color (hex)
Only some of the functions we need to work, the rest are called automatically.
Now let's begin ...

Installation / configuration of the system:

1. Copy the BiColorNames.inc folder in pawno / includes
2. Connect to include. Find the top fashion # include <a_samp> and add below:
Код:
 # include <BiColorNames>
3. add to the public OnGameModeInit () :
Код:
 LoadBiColorNames ();// Disable nicknames standard
Note: In your fashion in public OnGameModeInit () should be ShowNameTags (1);

4. In the public OnPlayerConnect (playerid) add:
Код:
ShowBiColorName (playerid, true); / / create an inscription over the player
5.B public OnPlayerDisconnect (playerid) add:
Код:
ShowBiColorName (playerid, false); / / delete 3Dtext over the player
6. In the public OnPlayerUpdate (playerid) add:
Код:
 UpdateIndicator (playerid); / / update the label
7. In the public OnPlayerDeath (playerid, killerid, reason) add:
Код:
DeathPlayer (playerid); / / update the label after his death
----------------------------------
Well, the main part, we implemented a mod.
Next I'll teach you to change colors, as well as how to properly update the nickname, etc.

Setting the colors in the spawn:

To set the colors in the spawn to use the SetPlayerBiColor (playerid, COLOR1, COLOR2, bool: Marker);

Options:
playerid - Player ID
COLOR1 - the color of the tag (color 1)
COLOR2 - username color (color 2)
bool: Marker - change the color of the player on the radar? true - yes; false - no. (A marker of the player takes the color of nickname)

In include I introduced 32 colors that you can use to test.
I even made the table:



For example if you want to put spawn in the following colors: BLUE_N - the color of the tag; RED_N - username color. If the nickname is not a tag, the name will be all one color.

To be placed in the following colors spawn in public OnPlayerSpawn (playerid) add:
Код:
 SetPlayerBiColor (playerid, BLUE_N, RED_N, true); / / expose the color of the player. true - and thus will change color on the radar.
This feature can be used in other public servers, for example, even when typing a command.

Change nick:

As our nickname is the 3dText, then after changing his nickname to be updated.
To change the nickname need Instead of the standard function SetPlayerName (playerid, name []); use the SetPlayerColorName (playerid, name []);

Options:
playerid - Player ID
name [] - the new name

For example:
Код:
 SetPlayerColorName (playerid, "Games ");
Create / delete 3DText over the player:

You can hide a nickname, HP and armor bar over the player.
During that meet the following functions:

Код:
ShowBiColorName (playerid, bool: enable); / / show / hide the inscription over the player
Options:
playerid - Player ID
bool: enable - show the inscription over the player? true - yes; false - there is no

Код:
ShowBiColorNameAll (bool: enable); / / show / hide the labels on all players
Options:
bool: enable - show the inscription over the players? true - yes; false - there is no

Show / Hide hp and armor bar:

You can disable the HP and armor bar, then over the player will be only his nickname.

During that meet the following functions:
Код:
ShowBarsPlayer (playerid, bool: enable); / / hide / show hp-bar and armour-bar over the player
Options:
playerid - Player ID
bool: enable - true - show; false - hide

Код:
 ShowBarsPlayerAll (bool: enable); / / hide / show hp-bar and armour-bar over the players
Options:
bool: enable true - show; false - hide

Basic script (use functions include)

I did exact same fs, where you can see the application functions, as well as hassle-free check include work.

fs Commands:
/ red - set the color of the tag - Green, Nick - red. (The color of the marker does not change)
/ purple - set the color of the tag - yellow, color nick - purple. (Marker color varies)
/ showbars [0 / 1] - show / hide your HP and armor bar. 1 - show, 0 - to hide.
/ showbarsall [0 / 1] - show / hide hp and armor bars all players. 1 - show, 0 - to hide.
/ showlabel [0 / 1] - create / delete the label. 1 - a, 0 - to remove.
/ showlabelall [0 / 1] - create / delete labels of all the players. 1 - a, 0 - to remove.
/ bicolorname [new nickname] - change the name

Download:

fs + include+ image with the colors: http://solidfiles.com/d/d66a/
Reply
#2

MmMm nice idea!
Reply
#3

Nice and unique, i should try this.

Thanks.
Reply
#4

Good job
Reply
#5

WTF!!Great JOB MAN
Reply
#6

Fantastic
Congratulations
Reply
#7

very nice well done!
Reply
#8

That is some sick shit
Reply
#9

The idea is well
Reply
#10

can someone translate the fs to english please i really need this for my server thanks
Reply
#11

Screenshot amazed me, for a mirror.
Reply
#12

Quote:
Originally Posted by David Skrbic
Посмотреть сообщение
MmMm nice idea!
Quote:
Originally Posted by Rock_Ro
Посмотреть сообщение
Nice and unique, i should try this.

Thanks.
Quote:
Originally Posted by Dwayne_
Посмотреть сообщение
Good job
Quote:
Originally Posted by Forbidden
Посмотреть сообщение
WTF!!Great JOB MAN
Quote:
Originally Posted by DJloko
Посмотреть сообщение
Fantastic
Congratulations
Quote:
Originally Posted by [Ask]Terminator
Посмотреть сообщение
very nice well done!
Quote:
Originally Posted by GangsTa_
Посмотреть сообщение
The idea is well
Thanks...

Quote:
Originally Posted by The Taker
Посмотреть сообщение
can someone translate the fs to english please i really need this for my server thanks
Ok, download: http://solidfiles.com/d/d66a/
Reply
#13

more comments please
Reply
#14

Ohh thats cool, I made something like this on my server though supports health only.
Reply
#15

This is really good, nice job!
Reply
#16

Thanks all
Reply
#17

Looks awesome, but im wondering
why are you using 256char strings if a nickname can only be 24 (or 32, cant remember the exact limit :P) characters max ?
Your wasting a lot of memory there...
Reply
#18

HP bar and Armour bar,color, too, takes up space.
I would also like to use, for example
* VIP * [Teg] Name - 3 colors
Reply
#19

Quote:
Originally Posted by Igorek
Посмотреть сообщение
HP bar and Armour bar,color, too, takes up space.
I would also like to use, for example
* VIP * [Teg] Name - 3 colors
Example:
{COLORR}* VIP * {COLORR}[Teg] {COLORR}Name \r\n •••••••••{ffffff}• \r\n •••••••••{ffffff}•

takes 90 characters, so i think 128 (maybe for longer names 140-150 chars) is more than enough and saves some ram usage
But still, nice script/good idea!
Reply
#20

Cool! Good job
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)