17.09.2011, 08:07
pawn Код:
dcmd_rulebreakers(playerid,params[])
{
#pragma unused params
new Count1;
new Count2;
new Count3;
new name[24];
new string1[128];
new string2[128];
new string3[128];
new string4[128];
new i;
if(PlayerInfo[playerid][Admin] >= 1)
{
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && Jail[i] == 1)
{
Count1++;
}
if(!Count1) return format(string1,sizeof(string1),"No Players Jailed");
else if(Count1 == 1)
{
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && Jail[i] == 1) break;
GetPlayerName(i,name,sizeof(name));
format(string1,sizeof(string1),"[JAILED]%s (id:%d)\n",name,i);
}
else if(Count1 >= 1)
{
new bool:First = false;
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && Jail[i] == 1)
{
GetPlayerName(i,name,sizeof(name));
if(!First)
{
format(string1,sizeof(string1),"[JAILED]%s (id:%d)\n",name,i);
First = true;
}
else
{
format(string1,sizeof(string1),"[JAILED]%s (id:%d)\n",name,i);
}
}
}
if(IsPlayerConnected(i) && Muted[i] == 1)
{
Count2++;
}
if(!Count2) return format(string2,sizeof(string2),"No Players Muted");
else if(Count2 == 1)
{
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && Muted[i] == 1) break;
GetPlayerName(i,name,sizeof(name));
format(string2,sizeof(string2),"[MUTED]%s (id:%d)\n",name,i);
}
else if(Count2 >= 1)
{
new bool:First = false;
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && Muted[i] == 1)
{
GetPlayerName(i,name,sizeof(name));
if(!First)
{
format(string2,sizeof(string2),"[MUTED]%s (id:%d)\n",name,i);
First = true;
}
else
{
format(string2,sizeof(string2),"[MUTED]%s (id:%d)\n",name,i);
}
}
}
if(IsPlayerConnected(i) && Freeze[i] == 1)
{
Count3++;
}
if(!Count3) return format(string3,sizeof(string3),"No Players Frozen");
else if(Count3 == 1)
{
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && Freeze[i] == 1) break;
GetPlayerName(i,name,sizeof(name));
format(string3,sizeof(string3),"[FROZEN]%s (id:%d)\n",name,i);
}
else if(Count3 >= 1)
{
new bool:First = false;
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && Freeze[i] == 1)
{
GetPlayerName(i,name,sizeof(name));
if(!First)
{
format(string3,sizeof(string3),"[FROZEN]%s (id:%d)\n",name,i);
First = true;
}
else
{
format(string3,sizeof(string3),"[FROZEN]%s (id:%d)\n",name,i);
}
}
}
format(string4,sizeof(string4),"%s\n%s\n%s\n",string1,string2,string3);
return ShowPlayerDialog(playerid,999,DIALOG_STYLE_MSGBOX,"Rule Breakers",string4,"OK","");
}
else
{
return SendClientMessage(playerid,orange,"Server: You do not have sufficient privileges to use this command");
}
}