CMD:contrato(playerid, params[]) { if (PlayerInfo[playerid][pOrg] == 1) { SendClientMessage(playerid, 0xFF0000AA, "[ERRO] Hitmans/Assassins nгo podem colocar contratos!"); return 1; } else { new id; new preco; if (sscanf(params, "ud", id, preco)) return SendClientMessage(playerid, 0xC0C0C0AA, "[INFO] Digite: /contrato [id] [preзo]"); PlayerInfo[id][pCont] = preco; return 1; } return 1; }
CMD:contratos(playerid)
{
new count = 0, iname[MAX_PLAYER_NAME], string[128];
if(Hitman[playerid] == 0)
return SendClientMessage(playerid, -1, "Vocк nгo й um Hitman/Assassins.");
for(new i; i < MAX_PLAYERS; i++)
{
if(Contratado[i] == 1 && IsPlayerConnected(i))
{
GetPlayerName(i, iname, MAX_PLAYER_NAME);
count++;
SendClientMessage(playerid, -1, "Contratos abertos:");
format(string, sizeof(string), "%s[%d]", iname, i);
SendClientMessage(playerid, -1, string);
}
}
if(count == 0)
return SendClientMessage(playerid, -1, "Nгo hб contratados online.");
return 1;
}
PHP код:
|
CMD:contratos(playerid)
{
static
name[MAX_PLAYER_NAME],
str[53];
SendClientMessage(playerid, -1, "Contratos:");
for (new i = 0, j = GetPlayerPoolSize(); i <= j; i ++)
{
if (!PlayerInfo[i][pCont])
continue;
GetPlayerName(i, name, sizeof(name));
format(str, sizeof(str), "Nome: %s - Preзo: %i", name, PlayerInfo[i][pCont]);
SendClientMessage(playerid, -1, str);
}
if (!strlen(str))
SendClientMessage(playerid, -1, "Nenhum contrato encontrado.");
return 1;
}
CMD:contratos(playerid) { new cstr[128]; MEGAString[0] = EOS; if(PlayerInfo[playerid][pOrg] != 1) return SendClientMessage(playerid, -1, "Vocк nгo й um Assassino."); strcat(MEGAString, "Id/Nome\tValor\n"); for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerInfo[i][pCont] > 0 && IsPlayerConnected(i)) { format(cstr, 128, "{FFFFFF}%d %s\t{00FF00}%d\n", i, GetName(i), PlayerInfo[i][pCont]); strcat(MEGAString, cstr); } } ShowPlayerDialog(playerid, 30303, DIALOG_STYLE_TABLIST_HEADERS, "Contratos", MEGAString, "Pegar", "Fechar"); return 1; } |
GetName(playerid) { new Name[24]; GetPlayerName(playerid, Name, sizeof Name); return Name; } |
PHP код:
|