14.08.2015, 09:07
I assume that 'rankname' is suppose to be a string, however you have it set up to be checked as a integer under sscanf.
If you get an error related to
, try using this.
That should fix it if an error shows up.
pawn Код:
command(setrankname, playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
new target, rankname[24], string[128]; //change [24] to however long you want the rank name to be at maximum
if(sscanf(params,"us[24]", target, rankname)) return SendClientMessage(playerid, GREY, "SYNTAX:{FFFFFF} /setrankname [ID] [rankname]");
{
PlayerInfo[target][pRankName] = rankname;
{
format(string, sizeof(string), "WARN: You changed: %s's rankname to: %s", RPName(target), PlayerInfo[playerid][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);
}
}
}
return 1;
}
Код:
PlayerInfo[target][pRankName] = rankname;
pawn Код:
format(string, sizeof(string), "%s", rankname);
PlayerInfo[target][pRankName] = string;