01.06.2016, 14:59
Why would he do that? Can't you see that faction is in fact an integer, and not a string?
I hate giving full codes, but you clearly don't want to try to do stuff yourself, as Infinity posted what you needed to get the player's name.
Код:
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 color, skin; switch (faction) { case 1: {color = 0xFF0000FF; skin = 250;} case 2: {color = 0x00FF00FF; skin = 12;} case 14: {color = 0x0000FFFF; skin = 55;} } SetPlayerSkin(para1, skin); SetPlayerColor(playerid, color); GetPlayerName(para1, str, 24); format(str, sizeof (str), "You have set %s's faction to %i.", str, 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; }