[Ajuda] Lucro da empresa
#2

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.


PHP код:
new ReceitaEmpresa = (dini_Int(STRX"Preco") * 10/100); 
PHP код:
public Usou11() {
    
Usou12();
    for(new 
0MAX_PROPp++) {
        
format(STRXsizeof(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 
0MAX_PROPp++) {
        
format(STRXsizeof(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 
0MAX_PROPp++) {
        
format(STRXsizeof(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(playeridpnamesizeof(pname));
    new 
aname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridanameMAX_PLAYER_NAME);
    for(new 
0MAX_PROPp++) {
        
format(stringsizeof(string), "/Props/prop%d.ini"p);
        
format(filesizeof(file), PASTA_CONTASaname);
        if(
dini_Exists(string)) {
            if(
IsPlayerInRangeOfPoint(playerid1.5dini_Float(string"PosX"), dini_Float(string"PosY"), dini_Float(string"PosZ"))) {
                if(
dini_Int(string"TDono") == 1) {
                    if(
strcmp(dini_Get(string"Dono"), pnametrue) == 0) {
                        
GivePlayerGrana(playeriddini_Int(string"Grana"));
                        
format(STRXsizeof(STRX), "| EMPRESA | Vocк pegou $%d de lucro de sua Empresa!"dini_Int(string"Grana"));
                        
SendClientMessage(playeridAmareloSTRX);
                    } else {
                        
SendClientMessage(playeridVermelho"| ERRO | Esta Empresa nгo e sua!");
                    }
                } else {
                    
SendClientMessage(playeridVermelho"| ERRO | Esta Empresa nгo tem dono!");
                }
            }
        }
    }
    return 
1;

Reply


Messages In This Thread
Lucro da empresa - by AutoMatic2 - 19.04.2018, 16:35
Re: Lucro da empresa - by [BOPE]Seu._.Madruga - 20.04.2018, 13:28
Re: Lucro da empresa - by AutoMatic2 - 20.04.2018, 15:22
Re: Lucro da empresa - by [BOPE]Seu._.Madruga - 20.04.2018, 17:02

Forum Jump:


Users browsing this thread: 3 Guest(s)