[Ajuda] Como faзo para criar um cofre para cada org?
#1

Eae galera blz... estou com uma dъvida, como crio um Cofre para cada org, qual variavel uso?

Se alguem puder me dar um exemplo fico grato
Reply
#2

Exemplo:
new CofreOrg[MAX_ORGS];
PHP код:
CMD:GranaOrg1(playeridparams[])
{
CofeOrg[1] = 50000;
return 
1;

Acho que assim funcionaria.
.
Reply
#3

E como seria se eu fosse dar dinheiro pro cofre?

pawn Код:
Cofre[.....] = 5000
Reply
#4

Quote:
Originally Posted by Nake01
Посмотреть сообщение
E como seria se eu fosse dar dinheiro pro cofre?

pawn Код:
Cofre[.....] = 5000
Cofre[NєDaOrg] = GRANA '-'.
Reply
#5

Ex:
pawn Код:
new Cofre[MAX_ORGS];
e depois eu coloco pra setar o dinheiro.

pawn Код:
Cofre[1] = GRANA
Cofre[2] = GRANA
Cofre[3] = GRANA
Assim ?
Reply
#6

Quote:
Originally Posted by Nake01
Посмотреть сообщение
Ex:
pawn Код:
new Cofre[MAX_ORGS];
e depois eu coloco pra setar o dinheiro.

pawn Код:
Cofre[1] = GRANA
Cofre[2] = GRANA
Cofre[3] = GRANA
Assim ?
Sim,
sу que nгo bota amais do limite (MAX_ORGS).
Reply
#7

E qual й *-*
Reply
#8

isto que vocк criou!

pawn Код:
#define MAX_ORGS   5

new org[MAX_ORGS];
no caso nгo pode ultrapassar de cinco orgs.


pawn Код:
org[0]  = DINHEIRO;
org[1]  = DINHEIRO;
org[2]  = DINHEIRO;
org[3]  = DINHEIRO;
org[4]  = DINHEIRO;
jб chegou ao mбximo!
Reply
#9

Ata tendi *-*, vou tentar fazer aqui
Reply
#10

qualquer erro poste!

Esperto ter ajudado

\/
Reply
#11

Coloquei assim mais quando vejo o saldo, vou depositar e sacar, aparece tudo zero sendo que no arquivo ta 50 MIL.
pawn Код:
if(dialogid == DIALOG_COFRECV)
    {
        format(cofres, sizeof(cofres), "Cofres/Cofres.ini");
        if(response)
        {
            if(listitem == 0)
            {
                static string[128];
                format(string, sizeof(string),"Por favor, digite a quantidade que deseja depositar no cofre.");
                ShowPlayerDialog(playerid, DIALOG_DEPOSITARCV, DIALOG_STYLE_INPUT,"~ DEPOSITAR ~", string,"Depositar","Voltar");
            }
            if(listitem == 1)
            {
                static string[128];
                format(string, sizeof(string),"O Saldo do cofre й de %d reais.", dini_Int(cofres, "CofreCV"));
                ShowPlayerDialog(playerid, DIALOG_SALDOCV, DIALOG_STYLE_MSGBOX,"Saldo do Cofre:", string, "Voltar","Cancelar");
            }
            if(listitem == 2)
            {
                static string[128];
                format(string, sizeof(string),"Por digite quantidade que deseja sacar do cofre, saldo do cofre й de %d reais", Cofre[1]);
                ShowPlayerDialog(playerid, DIALOG_SACARCV, DIALOG_STYLE_INPUT,"~ SACAR ~",string,"Sacar","Cancelar");
            }
        }
    }
    if(dialogid == DIALOG_SACARCV)
    {
        if(response)
        {
            new string[256];
            if(strval(inputtext) > Cofre[1]) return SendClientMessage(playerid, GetPlayerColor(playerid), "[COFRE] O Cofre nгo tem todo este dinheiro!");
            format(cofres, sizeof(cofres), "Cofres/Cofres.ini");
            dini_Create(cofres);
            format(string, sizeof(string), "[COFRE] Vocк Sacou: %s.", inputtext);
            SendClientMessage(playerid, COLOR_GREEN, string);
            Cofre[1] -= strval(inputtext);
            GivePlayerCash(playerid,strval(inputtext));
            dini_IntSet(cofres,"CofreCV", Cofre[1]);
        }
    }
    if(dialogid == DIALOG_DEPOSITARCV)
    {
        if(response)
        {
            new string[256];
            if(strval(inputtext) > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_RED,"[COFRE] Vocк nгo tem estб quantia!");
            format(cofres, sizeof(cofres), "Cofres/Cofres.ini");
            dini_Create(cofres);
            format(string, sizeof(string), "[COFRE] Vocк depositou: %s.", inputtext);
            SendClientMessage(playerid, COLOR_GREN, string);
            Cofre[1] += strval(inputtext);
            GivePlayerCash(playerid,-strval(inputtext));
            dini_IntSet(cofres,"CofreCV", Cofre[1]);
        }
    }
Reply
#12

pawn Код:
static
    Variable[30] = {200, ...};
Reply
#13

Poderia ser mais explicativo?
Reply
#14

Alguem?
Reply
#15

e o que eu poderia explicar ali meu filho?
Reply
#16

Isso -.-'
OnGameModeInit
pawn Код:
Cofre[1] = dini_Int("Cofres/Cofres.ini", "Cofre01");
Mais obrigado mesmo assim. consegui solucionar graзas б

https://sampforum.blast.hk/showthread.php?pid=984650#pid984650
Reply
#17

Use matrizes.
tipo Cofre[MAX_ORG][LOOT]
ai usa if(COFRE[ORGID][LOOT] == 1) para determinar maconha/crack/cocaina ou armas.
Reply
#18

por que vocк reviveu um post de 2011 ;--;
Reply
#19

sу as drogas
Reply
#20

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)