31.10.2015, 16:03
You are using playerid instead of giveplayerid, here.
pawn Код:
CMD:makeleader(playerid, params[])
{
new giveplayerid, fac, str[126];
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to do this.");
if(sscanf(params, "ui", giveplayerid, fac)) return SendClientMessage(playerid, -1, "USAGE: /makeleader [playerid/partofname] [faction]");
if(fac < 1 || fac > 5) return SendClientMessage(playerid, -1, "Valid faction number is 1-5");
PlayerInfo[giveplayerid][pFacLeader] = fac;
PlayerInfo[giveplayerid][pFaction] = fac;
PlayerInfo[givelayerid][pFacRank] = 6;
format(str, sizeof(str), "You have been give leadership powers over %s by %s.", GetFactionName(fac), GetName(playerid));
SendClientMessage(giveplayerid, COLOR_CYAN, str);
format(str, sizeof(str), "You have give %s leadership powers over %s.", GetName(playerid),GetFactionName(fac));
SendClientMessage(playerid, -1, str);
return 1;
}