ID:2246458
 
(See the best response by FKI.)
Code:
=====================================VAR===============================================================================
mob/var
showrank=0

//=====================================VERBS VIP===============================================================================
mob/Vip/verb
ShowRank()
set category = "Vip"
set name = "Show Rank"
if(!usr.showrank)
usr.showrank=1
usr.maptext="<font face=tahoma size='1'><b><center>[usr.rank]"
usr.maptext_y=-30
usr.maptext_x=-64
usr.maptext_width=160
else
usr.showrank=0
usr.maptext=""


//=====================================VAR===============================================================================
mob/var
showname=0

//=====================================VERBS VIP===============================================================================
mob/Vip/verb
ShowName()
set category = "Vip"
set name = "Show name"
if(!usr.showname)
usr.showname=1
usr.maptext="<font face=tahoma size='1'><b><center>[usr.name]"
usr.maptext_y=30
usr.maptext_x=-64
usr.maptext_width=160
else
usr.showname=0
usr.maptext=""


Problem description:
I want two commands, one to show the player's nickname and the other one to show the player's rank, but i don't know how to get two maptexts, as the var is the same in both of them they'll overwrite each other, how do i make other var for maptexting?
Best response
Since there is only a single maptext var per atom instance, you are going to have to create an additional object(s) and "attach" them to the target atom.

For example:
#define SHOW_NAME 1
#define SHOW_RANK 2

mob
var
show_flags = SHOW_NAME // show the player's name by default

tmp/image/maptext_rank

verb/show_rank()
if(!(show_flags & SHOW_RANK))
// toggle 'show rank' on
show_flags |= SHOW_RANK
// unshow the 'rank' maptext
overlays -= maptext_rank
// allow the maptext object to be garbage collected
maptext_rank = null
else
// toggle 'show rank' off
show_flags &= ~SHOW_RANK
maptext_rank = image(layer = FLOAT_LAYER)
// NOTE: make sure the x/y values of these do not overlap the 'name' maptext
maptext_rank.maptext = "pimp"
maptext_rank.maptext_x = x_pos
maptext_rank.maptext_y = y_pos
maptext_rank.maptext_width = 160
// show the 'rank' maptext
overlays += maptext_rank

verb/show_name()
// ...


Another option would be to generate the maptext var based on what should be written to it at run-time. For example, if both the player's name and rank should be shown, then add the player's name and append the rank to the maptext var. At least this method would allow you to continue to use the maptext var alone and not need to create an image or otherwise.
Thank youu, i'm going with the second option, there will be two vars if both are 1 it'll show "name
rank", two commands one var xD