31.05.2016, 18:56
Код:
CMD:makeleader(playerid, params[]) { if (Player[playerid][pAdmin] < 4) return SCM(playerid, ADMIN_COLOR, ADMIN_MESSAGE); new para1, faction; if (sscanf(params, "ui", para1, faction)) { SendClientMessage(playerid, COLOR_WHITE, "{00E6FF}USAGE:{FFFFFF} /makeleader [PlayerID/PartOfName] [Faction 1 - 15]"); SendClientMessage(playerid, COLOR_LIGHTBLUE, "1: Police Department || 2: F.B.I || 3: National Guard || 4: Medics"); SendClientMessage(playerid, COLOR_LIGHTBLUE, "5: The Mafia || 6: The Triads || 7: Mayor || 8: Hitman Agency"); SendClientMessage(playerid, COLOR_LIGHTBLUE, "9: News Reporter || 10: Taxi Company || 11: Los Santos Vagos || 12: Varrios Los Aztecas"); SendClientMessage(playerid, COLOR_LIGHTBLUE, "13: Ballas || 14: Grove Street || 15: NFS Club"); return 1; } if (para1 == INVALID_PLAYER_ID) return SCM(playerid, -1, "Player is not connected."); if (faction < 1 || faction > 15) return SCM(playerid, -1, "{00E6FF}USAGE:{FFFFFF} /makeleader [PlayerID/PartOfName] {FF0000}[Faction 1 - 15]"); new str[72], skin; switch (faction) { case 1: {str = "0xFF0000FF"; skin = 250;} case 2: {str = "Name2"; skin = 12;} case 14: {str = "Name15"; skin = 55;} } SetPlayerSkin(para1, skin); SetPlayerName(para1, strval(str)); format(str, sizeof (str), "You have set %s (%i)'s faction to %i.", str, para1, faction); SendClientMessage(playerid, -1, str); GetPlayerName(playerid, str, 24); format(str, sizeof (str), "Your faction has been changed to %i by %s (%i)", faction, str, playerid); SendClientMessage(para1, -1, str); Player[para1][pLeader] = faction; return 1; }
How would I be able to do this?