13.10.2009, 14:37
Hello, I have a tiny problem with my /jaillist command, the problem is when someone is jailed when a cop types /jaillist it shows the players that are jailed only on 1 columb example
Name: %s | ID: %d | Jail Time: %d sec,Name: %s | ID: %d | Jail Time: %d sec,Name: %s | ID: %d | Jail Time: %d sec and I dont want it like this
I want when he types /jaillist to show the list of the jailed people, for example:
Name: %s | ID: %d | Jail Time: %d sec
Name: %s | ID: %d | Jail Time: %d sec
Name: %s | ID: %d | Jail Time: %d sec
Here is the command:
If someone knows please post here
Name: %s | ID: %d | Jail Time: %d sec,Name: %s | ID: %d | Jail Time: %d sec,Name: %s | ID: %d | Jail Time: %d sec and I dont want it like this
I want when he types /jaillist to show the list of the jailed people, for example:
Name: %s | ID: %d | Jail Time: %d sec
Name: %s | ID: %d | Jail Time: %d sec
Name: %s | ID: %d | Jail Time: %d sec
Here is the command:
pawn Код:
if(strcmp(cmd, "/jaillist", true) == 0 || strcmp(cmd, "/jl", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3)
{
new x;
SendClientMessage(playerid, COLOR_DBLUE, "-= JAIL LIST =-");
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pJailTime] > 0)
{
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Name: %s%s | ID: %d | Jail Time: %d sec", string,giveplayer,i,PlayerInfo[i][pJailTime]);
x++;
if(x > 3)
{
SendClientMessage(playerid, COLOR_YELLOW, string);
x = 0;
format(string, sizeof(string), "");
}
else
{
format(string, sizeof(string), "%s, ", string);
}
}
}
}
if(x <= 3 && x > 0) {
string[strlen(string)-2] = '.';
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not PD / FBI / LS Council !");
}
}//not connected
return 1;
}