02.02.2013, 13:44
pawn Код:
if(strcmp(cmd, "/gov", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] > 0 && PlayerInfo[playerid][pMember] < 8 && DivisionInfo[PlayerInfo[playerid][pDivision]][PlayerInfo[playerid][pMember]][divCanGov])
{
if(PlayerInfo[playerid][pMask]) return SendClientMessage(playerid, COLOR_GREY, "You aren't allowed to use this feature while having a mask on.");
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/gov)ernment [text]");
format(string, sizeof(string), "Announcement: %s %s: %s",GetPlayerRank(playerid),GetPlayerNameEx(playerid), result);
OOCOff(COLOR_DBLUE,string);
if(UseAdmCmdTimer[playerid] > 4)
{
PlayerInfo[playerid][pRank] = 0;
PlayerInfo[playerid][pLeader] = 0;
PlayerInfo[playerid][pMember] = 0;
format(string, sizeof(string), "AdmCmd: %s (ID: %d) has been signalised spamming the (/gov) command and has been kicked from the %s.", GetPlayerNameEx(playerid), playerid, GetPlayerFactionName(playerid));
ABroadCast(COLOR_LIGHTRED, string, 1);
SendClientMessage(playerid, COLOR_LIGHTRED, "You have been kicked from your faction due to spamming LEO commands.");
SetPlayerToTeamColor(playerid);
}
}
}
return 1;
}