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;
}
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);
|
http://forum.sa-mp.com/showpost.php?...99&postcount=9
You could have just told me that you didn't understand, you didn't have to make a new thread. Код:
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);
|
format(string, sizeof (string), "You have set %s's faction to %i.", para1, faction ); SendClientMessage(playerid, -1, string); GetPlayerName(para1, faction, sizeof(faction)); format(string, sizeof (string), "Your faction has been changed to %i by %s (%i)", faction, para1); SendClientMessage(para1, -1, string); Player[para1][pLeader] = faction; return 1; }
GetPlayerName(para1, faction, sizeof(faction));
format(string, sizeof (string), "You have set %i's faction to %s.", para1, faction );
SendClientMessage(playerid, -1, string);
format(string, sizeof (string), "Your faction has been changed to %i by %s (%i)", faction, para1);
SendClientMessage(para1, -1, string);
Player[para1][pLeader] = faction;
return 1;
}
GM.pwn(507) : error 035: argument type mismatch (argument 2) GM.pwn(507) : error 035: argument type mismatch (argument 2)
GetPlayerName(para1, faction, sizeof(faction));
new para1, faction;
new para1, faction[30];
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;
}