16.04.2013, 05:32
pawn Код:
CMD:makeleader(playerid, params[])
{
new targetid, factionid, string[128], targetname[24], playername[24];
if(sscanf(params, "ui", targetid, factionid)) return SendClientMessage(playerid, -1, "Usage: /makeleader [playerid][factionid]");
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid playerid!");
if(0 < factionid < 3)
{
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(targetid, targetname, sizeof(targetname));
format(string, sizeof(string), "You made %s leader of faction id %i!", targetname, factionid);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "You were made leader of faction id %i by %s", factionid, playername);//Formats the string that the player will receive
SendClientMessage(playerid, -1, string);
PlayerInfo[playerid][pFaction] == factionid; //1957
PlayerInfo[playerid][pRank] == 6; //1958
}
else return SendClientMessage(playerid, -1, "Invalid factionid. Factionid's: 1-2");
return 1;
}
Код:
ers\Michael\Desktop\test\gamemodes\Wildside.pwn(1957) : warning 215: expression has no effect C:\Users\Michael\Desktop\test\gamemodes\Wildside.pwn(1958) : warning 215: expression has no effect Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.