CMD:wfdebt(playerid, params[])
{
new string[ 512 ];
new cnt = 0;
new name[ MAX_PLAYER_NAME + 1 ];
foreach(new i: Player) {
if(GetPlayerMoney(i) < 0) {
cnt++;
GetPlayerName(i, name, sizeof name);
format(string, sizeof string, "%s\n%s", string, name);
}
}
if(cnt == 0) {
//No players in debt
}
else {
ShowPlayerDialog(..., string, ...);
}
return 1;
}
pawn Код:
|
CMD:wfdebt(playerid, params[]) { if(gTeam[playerid] == 2 || IsACop(playerid)|| PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pMember] == 7 && PlayerInfo[playerid][pRank] >= 6) { new string[128], x; SendClientMessageEx(playerid, COLOR_GREEN, "Current Wanted in Debt:"); foreach(Player, i) { if(GetPlayerCash(i) < 0) { format(string, sizeof(string), "%s%s: %d", string,GetPlayerNameEx(i),GetPlayerCash(i)); x++; if(x > 3) { SendClientMessageEx(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] = '.'; SendClientMessageEx(playerid, COLOR_YELLOW, string); } } else { SendClientMessageEx(playerid, COLOR_GREY, " You're not a Cop / Debt Collectors or Government"); } return 1; }
CMD:wfdebt(playerid, params[])
{
if(gTeam[playerid] == 2 || IsACop(playerid)|| PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pMember] == 7 && PlayerInfo[playerid][pRank] >= 6)
{
new string[128], x;
foreach(Player, i)
{
if(GetPlayerCash(i) < 0)
{
format(string, sizeof(string), "%s\n%s: %d", string,GetPlayerNameEx(i),GetPlayerCash(i));
x++;
}
}
if(x != 0)
{
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_MSGBOX, "Current Players Wanted in Debt:", string, "Okay", button2[]);
} else {
// No players in debt
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " You're not a Cop / Debt Collectors or Government");
}
return 1;
}