Код:
CMD:ainvite(playerid, params[])
{
new faction, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], id, string[128];
GetPlayerName(id, name, sizeof(name));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pAdmin] < 6) return SCM(playerid, GREY, NOADMIN);
{
if(sscanf(params,"ud", id, faction)) return SCM(playerid, COLOR_GREY, "Usage: /invite [playerid] [Faction ID]");
{
switch(faction)
{
case 0:
{
PlayerInfo[id][pFaction] = 0;
PlayerInfo[id][pRank] = 0;
format(string,sizeof(string),"{006600}[AdmCmd]{FFFFFF} You are now a civilian.");
SCM(id,COLOR_WHITE,string);
format(string,sizeof(string),"You made %s a civilian!", name);
SCM(playerid,COLOR_YELLOW,string);
}
case 1:
{
PlayerInfo[id][pFaction] = 1;
PlayerInfo[id][pRank] = 10;
format(string,sizeof(string),"{006600}[AdmCmd] {FFFFFF}You were added to the Sheriff's Department.");
SCM(id,COLOR_WHITE,string);
format(string,sizeof(string),"You invited %s to the Sheriff's Department!", name);
SCM(playerid,COLOR_YELLOW,string);
}
case 2:
{
PlayerInfo[id][pFaction] = 2;
PlayerInfo[id][pRank] = 9;
format(string,sizeof(string),"{006600}[AdmCmd]{FFFFFF} You were added to the Fire Department.");
SCM(id,COLOR_WHITE,string);
format(string,sizeof(string),"You invited %s to the Fire Department!", name);
SCM(playerid,COLOR_YELLOW,string);
}
case 3:
{
PlayerInfo[id][pFaction] = 3;
PlayerInfo[id][pRank] = 7;
format(string,sizeof(string),"{006600}[AdmCmd]{FFFFFF} You were added to the Medical Department.");
SCM(id,COLOR_WHITE,string);
format(string,sizeof(string),"You invited %s to the Medical Department!", name);
SCM(playerid,COLOR_YELLOW,string);
}
case 4:
{
PlayerInfo[id][pFaction] = 4;
PlayerInfo[id][pRank] = 7;
format(string,sizeof(string),"{006600}[AdmCmd]{FFFFFF} You were added to Red Line Racing.");
SCM(id,COLOR_WHITE,string);
format(string,sizeof(string),"You invited %s to Red Line Racing!", name);
SCM(playerid,COLOR_YELLOW,string);
}
case 5:
{
PlayerInfo[id][pFaction] = 5;
PlayerInfo[id][pRank] = 10;
format(string,sizeof(string),"{006600}[AdmCmd]{FFFFFF} You were added to the Department of Corrections.");
SCM(id,COLOR_WHITE,string);
format(string,sizeof(string),"You invited %s to DoC", name);
SCM(playerid,COLOR_YELLOW,string);
}
case 6:
{
PlayerInfo[id][pFaction] = 6;
PlayerInfo[id][pRank] = 12;
format(string,sizeof(string),"{006600}[AdmCmd]{FFFFFF} You were added to the Police Department.");
SCM(id,COLOR_WHITE,string);
format(string,sizeof(string),"You invited %s to LSPD", name);
SCM(playerid,COLOR_YELLOW,string);
}
default:
{
SCM(playerid, GREY, "Factions 1-6 only");
SCM(playerid, GREY, "[1 - Sheriff's | 2 - Fire | 3 - EMS | 4 - RRC | 5 - DoC | 6 - LSPD]");
}
}
}
}
return 1;
}
The whole client message for this command is bugged. Kinda weird- only returns messages to ID 0.