SA-MP Forums Archive
[Ajuda] Estudando essa funзгo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Estudando essa funзгo (/showthread.php?tid=458218)



Estudando essa funзгo - View - 15.08.2013

Olб galera, estou estudando alguns gms p entender como funciona ..resolvi olhar isso aqui..me ajudem pf a entender..como estou comeзando agora, talves eu esteja errado...essa funзгo estб me dizendo q quando eu der /cartaoon o saldo bancбrio da mгo do player irб vir para mгo? como posso inverter isso, tipo o saldo n vim p mгo porem o player poder realizar compras com ele ativado?

pawn Код:
stock GivePlayerGrana(playerid, ammount){
                if(dini_Int(filena(playerid),"CartaoOn") == 0){
                    return Grana[playerid] += ammount;
                } else return dini_IntSet(filena(playerid),"SaldoBancario",dini_Int(filena(playerid),"SaldoBancario")+ammount);
            }
            stock GetPlayerGrana(playerid){
                if(dini_Int(filena(playerid),"CartaoOn") == 0){
                    return Grana[playerid];
                } else return dini_Int(filena(playerid),"SaldoBancario"); // <<<< saldo ir mгo?
            }



Re: Estudando essa funзгo - PT - 15.08.2013

cara isso sao 2 stocks
olha so com identacao

pawn Код:
stock GivePlayerGrana(playerid, ammount)
{
    if(dini_Int(filena(playerid),"CartaoOn") == 0)
    {
        return Grana[playerid] += ammount;
    }
    else return dini_IntSet(filena(playerid),"SaldoBancario",dini_Int(filena(playerid),"SaldoBancario")+ammount);
}

stock GetPlayerGrana(playerid)
{
    if(dini_Int(filena(playerid),"CartaoOn") == 0)
    {
        return Grana[playerid];
    }
    else return dini_Int(filena(playerid),"SaldoBancario"); // <<<< saldo ir mгo?
}
e nao tendi que vc quer


Re: Estudando essa funзгo - View - 16.08.2013

Mano sei isso sгo 2 stocks, o que quero dizer й q estou a entende-las, no momento n estou mt preocupado c indentar e sim em entender passo a passo o q ela realiza