[GUIDE] Chat prefix for ranks( Different methods)

Heya, in this guide we will be discussing about the different methods for creating chat prefix, No one likes too many if-else.

1st method-​

This method includes using only one variable for handling player prefix. You just have to change the variable value and DONE!​
Player event( chat msg.) -> Game action( Cancel) -> Send msg.( "%player%-prefix(saved)" "Game value(Player message)")​
You can change the value of variable %player%-prefix as you like. You have to decide on how you will change the value if it's from a transaction, Kill, Certain message.​

2nd method-​

This method invloves using arrays and is very useful in certain condtions.​
Example: Certain amount of Kills Set player Prefix to certain text.​
arr(Prefix) = [ Novice, Intermediate, Expert, Master]

Player event( Chat msg.) -> Game action( Cancel) -> Get element( Prefix, %player%-prefix-Index, %player%-prefix-TXT) -> Send msg.( "%player%-prefix-TXT" "game value(Player msg.")​
Here we first initialize an array, make sure that its saved and add rank as you like. In this manner you can increment the variable "%player%-prefix-Index" if you want to upgrade player rank.​


Well there you have it, two methods for chat-prefix w/o using if-else again & again.
Consider liking the post <3
 
Top