tmp_in.y += (duel_score_size.y - duel_name_fontsize.y) / 2;
// RJZ rank
- int rank = entcs_GetRank(pl.sv_entnum);
- string rank_str = "";
- if(rank) {
- rank_str = strcat("(", ftos(rank), ")");
+ string rank_str = entcs_GetRank(pl.sv_entnum);
+ if(rank_str) {
if(invert)
tmp_in.x -= stringwidth_colors(rank_str, duel_name_fontsize) + duel_name_fontsize.x * 0.5;
else
if(invert)
tmp_in.x -= stringwidth_colors(tmp_str, duel_name_fontsize) + duel_name_fontsize.x * 0.5;
else
- tmp_in.x += (rank ? stringwidth_colors(rank_str, duel_name_fontsize) : duel_score_size.x) + duel_name_fontsize.x * 0.5;
+ tmp_in.x += (rank_str ? stringwidth_colors(rank_str, duel_name_fontsize) : duel_score_size.x) + duel_name_fontsize.x * 0.5;
drawcolorcodedstring(tmp_in, tmp_str, duel_name_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
//LegendGuard adds a conditional sentence for country column 05-04-2021
tmp.y += ((teamscore_size.y / 2) - teamname_fontsize.y) / 2;
tmp.y += teamscore_size.y / 2;
- // RJZ rank
- int rank = entcs_GetRank(pl.sv_entnum);
- string rank_str = "";
- if(rank) {
- rank_str = strcat("(", ftos(rank), ")");
+ // RJZ rank
+ string rank_str = entcs_GetRank(pl.sv_entnum);
+ if(rank_str) {
if(invert)
tmp.x -= stringwidth_colors(rank_str, teamname_fontsize) + teamname_fontsize.x * 0.5;
else
if(invert)
tmp.x -= stringwidth_colors(tmp_str, teamname_fontsize) + teamname_fontsize.x * 0.5;
else
- tmp.x += (rank ? stringwidth_colors(rank_str, teamname_fontsize) : teamscore_size.x) + teamname_fontsize.x * 0.5;
+ tmp.x += (rank_str ? stringwidth_colors(rank_str, teamname_fontsize) : teamscore_size.x) + teamname_fontsize.x * 0.5;
drawcolorcodedstring(tmp, tmp_str, teamname_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
}
.int team;
.int team_size;
.int countrycode;
-.int rank;
+.string rank;
int binddb;
{ ent.countrycode = ReadByte(); })
ENTCS_PROP(RANK, true, rank, rank, ENTCS_SET_NORMAL,
- { WriteByte(chan, ent.rank); },
- { ent.rank = ReadByte(); })
+ { WriteString(chan, ent.rank); },
+ { strcpy(ent.rank, ReadString()); })
// use sv_solid to avoid changing solidity state of entcs entities
ENTCS_PROP(SOLID, true, sv_solid, solid, ENTCS_SET_NORMAL,
return e.countrycode;
}
- int entcs_GetRank(int i)
+ string entcs_GetRank(int i)
{
entity e = entcs_receiver(i);
- return e.rank;
+ return (e.rank != "" ? e.rank : string_null);
}
/**
GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? GameLog_ProcessIP(this.netaddress) : "bot"), ":", playername(this.netname, this.team, false)));
/* z411 for RJZ */
- if(autocvar_rjz_ranks) GameLogEcho(strcat(":idfp:", this.crypto_idfp));
+ if(autocvar_rjz_ranks) GameLogEcho(strcat(":idfp:", ftos(etof(this)), ":", this.crypto_idfp));
}
CS(this).just_joined = true; // stop spamming the eventlog with additional lines when the client connects
ATTRIB(Client, team, int, this.team);
ATTRIB(Client, clientcolors, int, this.clientcolors);
ATTRIB(Client, countrycode, int, this.countrycode);
- ATTRIB(Client, rank, int, this.rank);
+ ATTRIB(Client, rank, string, this.rank);
/** Client IP */
ATTRIB(Client, netaddress, string, this.netaddress);
ATTRIB(Client, playermodel, string, this.playermodel);
.float lastkill;
.int countrycode;
.int killcount;
-.int rank;
+.string rank; // RJZ
//flood fields
.float nickspamtime; // time of last nick change
if (accepted <= 0)
{
LOG_INFO("^1ERROR^7: Couldn't set player rank");
- LOG_HELP("Usage:^3 sv_cmd setrank #client_id #rank");
+ LOG_HELP("Usage:^3 sv_cmd setrank #client_id rank");
return;
}
- client.rank = stof(argv(2));
+ client.rank = strzone(argv(2));
LOG_INFO("^2SUCCESS^7: Player rank set!");
return;
}