23.07.2013, 19:46
(
Последний раз редактировалось ThaCrypte; 26.07.2013 в 21:14.
)
Well, currently i've been having trouble's with ranks.
The command works, but there's a slight bug in the saving to the userfile.
Since whenever you set the rank, it show's correctly, but saves as numbers in the .ini
And when you relogg, the rank is being weird.
For example:
Bob does /setrank Peter Boss.
Peter logs out to piss, and logs back in.
Peter type's /stats, and notice's his rank name is Bo.
The cmd:
The command works, but there's a slight bug in the saving to the userfile.
Since whenever you set the rank, it show's correctly, but saves as numbers in the .ini
And when you relogg, the rank is being weird.
For example:
Bob does /setrank Peter Boss.
Peter logs out to piss, and logs back in.
Peter type's /stats, and notice's his rank name is Bo.
The cmd:
pawn Код:
CMD:setrank(playerid, params[])
{
new name[32], playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
if(PlayerInfo[playerb][pFac] != PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is not in your faction.");
if(sscanf(params, "us[32]", playerb, name)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /setrank [player] [name]");
{
format(PlayerInfo[playerb][pFRank], 32,"%s", name);
format(string, sizeof(string), "You have changed the rankname to %s", name);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
return 1;
}