15.12.2014, 01:23
Evening I created an /rankname command for the faction leaders that they can set an Custom Rank but its not saving in the file can someone help me out of it
pawn Код:
CMD:rankname(playerid, params[])
{
new 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(sscanf(params, "us", playerb, params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /rankname [playerid] [rank]");
if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't change your rank.");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(PlayerInfo[playerb][pFac] != PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is not in your faction.");
format(PlayerInfo[playerb][pFacRanN], 60, "%s", params);
format(string, sizeof(string), "You have changed the Rank Name from %s to %s.", RPN(playerb), params);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s has changed your Rank Name to %s", RPN(playerid), params);
SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
return 1;
}
pawn Код:
//on stock loadhcar
format(PlayerInfo[playerid][pFacRanN], 60, "%s", dini_Get(file, "FacRanN"));
pawn Код:
//on savechar
dini_IntSet(file, "FacRankN", PlayerInfo[playerid][pFacRanN]);
pawn Код:
//on clear char
format(PlayerInfo[playerid][pFacRanN], 64, "");
pawn Код:
pFacRanN[60],