20.04.2018, 13:28
Leonardo Bradoks jogou fora 10% das 500000 laranjas que ele tinha. Quantas laranjas foram pro lixo?
500000 x 10/100 (dez por cento) = 50000 laranjas
Portanto, 50000 laranjas foram jogadas fora por Leonardo Bradoks.
500000 x 10/100 (dez por cento) = 50000 laranjas
Portanto, 50000 laranjas foram jogadas fora por Leonardo Bradoks.
PHP код:
new ReceitaEmpresa = (dini_Int(STRX, "Preco") * 10/100);
PHP код:
public Usou11() {
Usou12();
for(new p = 0; p < MAX_PROP; p++) {
format(STRX, sizeof(STRX), "/Props/prop%d.ini", p);
if(dini_Exists(STRX)) {
if(dini_Int(STRX ,"entrega") >= 1) {
dini_IntSet(STRX, "producao", dini_Int(STRX, "producao")-1);
if(dini_Int(STRX, "producao") <= 0) {
dini_IntSet(STRX,"producao", 0);
dini_IntSet(STRX,"entrega", 0);
new ReceitaEmpresa = (dini_Int(STRX, "Preco") * 10/100);
if(dini_Int(STRX, "Grana")+ReceitaEmpresa >= 1000000) {
dini_IntSet(STRX, "Grana", 1000000);
} else {
dini_IntSet(STRX, "Grana", dini_Int(STRX, "Grana")+ReceitaEmpresa);
}
}
}
}
}
}
public Usou12() {
Usou13();
for(new p = 0; p < MAX_PROP; p++) {
format(STRX, sizeof(STRX), "/Props/prop%d.ini", p);
if(dini_Exists(STRX)) {
if(dini_Int(STRX ,"eentrega1") >= 1) {
dini_IntSet(STRX, "pproducao1", dini_Int(STRX, "pproducao1")-1);
if(dini_Int(STRX, "pproducao1") <= 0) {
dini_IntSet(STRX,"pproducao1", 0);
dini_IntSet(STRX,"eentrega1", 0);
new ReceitaEmpresa = (dini_Int(STRX, "Preco") * 10/100);
if(dini_Int(STRX, "Grana")+ReceitaEmpresa >= 1000000) {
dini_IntSet(STRX, "Grana", 1000000);
} else {
dini_IntSet(STRX, "Grana", dini_Int(STRX, "Grana")+ReceitaEmpresa);
}
}
}
}
}
}
public Usou13() {
for(new p = 0; p < MAX_PROP; p++) {
format(STRX, sizeof(STRX), "/Props/prop%d.ini", p);
if(dini_Exists(STRX)) {
if(dini_Int(STRX ,"eentrega2") >= 1) {
dini_IntSet(STRX, "pproducao2", dini_Int(STRX, "pproducao2")-1);
if(dini_Int(STRX, "pproducao2") <= 0) {
dini_IntSet(STRX,"pproducao2", 0);
dini_IntSet(STRX,"eentrega2", 0);
new ReceitaEmpresa = (dini_Int(STRX, "Preco") * 10/100);
if(dini_Int(STRX, "Grana")+ReceitaEmpresa >= 1000000) {
dini_IntSet(STRX, "Grana", 1000000);
} else {
dini_IntSet(STRX, "Grana", dini_Int(STRX, "Grana")+ReceitaEmpresa);
}
}
}
}
}
}
if(strcmp(cmdtext, "/retirarlucro", true) == 0) {
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
for(new p = 0; p < MAX_PROP; p++) {
format(string, sizeof(string), "/Props/prop%d.ini", p);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Exists(string)) {
if(IsPlayerInRangeOfPoint(playerid, 1.5, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ"))) {
if(dini_Int(string, "TDono") == 1) {
if(strcmp(dini_Get(string, "Dono"), pname, true) == 0) {
GivePlayerGrana(playerid, dini_Int(string, "Grana"));
format(STRX, sizeof(STRX), "| EMPRESA | Vocк pegou $%d de lucro de sua Empresa!", dini_Int(string, "Grana"));
SendClientMessage(playerid, Amarelo, STRX);
} else {
SendClientMessage(playerid, Vermelho, "| ERRO | Esta Empresa nгo e sua!");
}
} else {
SendClientMessage(playerid, Vermelho, "| ERRO | Esta Empresa nгo tem dono!");
}
}
}
}
return 1;
}