Rank name not loading properly. -
OMonger - 23.10.2015
I have a command, /stats, which shows a players faction and rank name after they relog. However it keeps showing only one letter from the rank, usually the beginning letter. This is the rank name enum:
This is the /stats stock:
Код:
stock ShowStatistics(playerid, id)
{
if(playerid == id)
{
new string[255];
format(string, sizeof(string), ". : : Statistics : : .");
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "| Level: %d | Cash: $%d |", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pCash]);
SendClientMessage(playerid, SERVERCOLOR, string);
format(string, sizeof(string), "| Faction: %s (%d) | Rank Name: %s |", faclist(playerid), PlayerInfo[playerid][pRank], PlayerInfo[playerid][pRankName]);
SendClientMessage(playerid, SERVERCOLOR, string);
}
return 1;
}
Re: Rank name not loading properly. -
ATGOggy - 23.10.2015
Where did u give pRankname a value?
Re: Rank name not loading properly. -
OMonger - 23.10.2015
Quote:
Originally Posted by ATGOggy
Where did u give pRankname a value?
|
I gave it at a value at the pInfo enum.
Re: Rank name not loading properly. -
ATGOggy - 23.10.2015
I mean show us the code where this variable gets a rank name
Re: Rank name not loading properly. -
OMonger - 23.10.2015
Quote:
Originally Posted by ATGOggy
I mean show us the code where this variable gets a rank name
|
Код:
command(rankname, playerid, params[])
{
if(PlayerInfo[playerid][pRank] == 7)
{
new target, rankname[128];
if(sscanf(params,"us[64]", target, rankname)) return SendClientMessage(playerid, GREY, "SYNTAX:{FFFFFF} /setrankname [ID] [rankname]");
{
new string[128];
format(PlayerInfo[playerid][pRankName], 255, "%s", rankname);
format(string, sizeof(string), "WARN: You changed: %s's rankname to: %s", RPName(target), PlayerInfo[target][pRankName]);
SendClientMessage(playerid, ADMINBLUE, string);
format(string, sizeof(string), "WARN: %s has changed your rankname to: %s", RPName(playerid), PlayerInfo[playerid][pRankName]);
SendClientMessage(target, ADMINBLUE, string);
}
}
else
{
RemoveTextMessage(playerid);
TextDrawShowForPlayer(playerid, Text:CantCommand);
SetTimerEx("CantCommand", 3500, false, "d", playerid);
}
return 1;
}
This is the command for setting rank names.
Re: Rank name not loading properly. -
ATGOggy - 24.10.2015
Change this:
pawn Код:
format(PlayerInfo[playerid][pRankName], 255, "%s", rankname);
to this:
pawn Код:
format(PlayerInfo[target][pRankName], 255, "%s", rankname);
and try
Re: Rank name not loading properly. -
OMonger - 24.10.2015
Seems to have fixed! Thanks bro! +rep'd