13.09.2011, 21:33
I have constructed this command:
Could someone modify this command so it is a dialog like this:
[title]Rule Breakers[/title]
Jailed Players:
No jailed players
Muted Players:
No muted players
Frozen Players:
No frozen players
Could someone modify this command to make it like this please? Your help will be much appreciated.
pawn Код:
dcmd_rulebreakers(playerid,params[])
{
#pragma unused params
new Count;
new name[24];
new string[128];
new i;
if(PlayerInfo[playerid][Admin] >= 1)
{
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && Jail[i] == 1)
{
Count++;
}
if(!Count) return SendClientMessage(playerid,orange,"Server: No players jailed");
if(Count == 1)
{
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && Jail[i] == 1) break;
GetPlayerName(i,name,sizeof(name));
format(string,sizeof(string),"Server: [JAILED]%s (id:%d)\n",name,i);
return SendClientMessage(playerid,orange,string);
}
if(Count >= 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(string,sizeof(string),"Server: [JAILED]%s (id:%d)\n",name,i);
First = true;
}
else
{
format(string,sizeof(string),"Server: [JAILED]%s (id:%d)\n",name,i);
}
}
return SendClientMessage(playerid,orange,string);
}
if(IsPlayerConnected(i) && Muted[i] == 1)
{
Count++;
}
if(!Count) return SendClientMessage(playerid,orange,"Server: No players muted");
if(Count == 1)
{
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && Muted[i] == 1) break;
GetPlayerName(i,name,sizeof(name));
format(string,sizeof(string),"Server: [MUTED]%s (id:%d)\n",name,i);
return SendClientMessage(playerid,orange,string);
}
if(Count >= 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(string,sizeof(string),"Server: [MUTED]%s (id:%d)\n",name,i);
First = true;
}
else
{
format(string,sizeof(string),"Server: [MUTED]%s (id:%d)\n",name,i);
}
}
return SendClientMessage(playerid,orange,string);
}
if(IsPlayerConnected(i) && Freeze[i] == 1)
{
Count++;
}
if(!Count) return SendClientMessage(playerid,orange,"Server: No players frozen");
if(Count == 1)
{
for(i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && Freeze[i] == 1) break;
GetPlayerName(i,name,sizeof(name));
format(string,sizeof(string),"Server: [FROZEN]%s (id:%d)\n",name,i);
return SendClientMessage(playerid,orange,string);
}
if(Count >= 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(string,sizeof(string),"Server: [FROZEN]%s (id:%d)\n",name,i);
First = true;
}
else
{
format(string,sizeof(string),"Server: [FROZEN]%s (id:%d)\n",name,i);
}
}
return SendClientMessage(playerid,orange,string);
}
return 1;
}
else
{
return SendClientMessage(playerid,orange,"Server: You do not have sufficient privileges to use this command");
}
}
[title]Rule Breakers[/title]
Jailed Players:
No jailed players
Muted Players:
No muted players
Frozen Players:
No frozen players
Could someone modify this command to make it like this please? Your help will be much appreciated.