[Ajuda] Carregamento
#6

Manda os errros e tbm manda mais code acima do seu comando de entregar Carga!

pawn Код:
if(strcmp(cmd, "/abastecer", true) == 0) {
        new tmp[256];
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
        format(file, sizeof(file), PASTA_CONTAS, aname);
        new quantidade;
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,sizeof(pName));
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)){
            SendClientMessage(playerid, Vermelho, "[ERRO] Use: /abastecer [litros]");
            return 1;
        }
        quantidade = strval(tmp);
        if(quantidade <= 0 || GetPlayerGrana(playerid) < quantidade){
            SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente para pagar o frentista.");
            return 1;
        }
        if(AreaPosto[playerid] == 1){ // se estiver na area
            if(quantidade + dini_Int(file, "Combustivel") < 100){
                dini_IntSet(file, "Combustivel", dini_Int(file, "Combustivel") + quantidade);
                format(string, sizeof(string), "(INFO) Vocк completou seu tanque com %d litros de combustнvel.", quantidade);
                SendClientMessage(playerid, COLOR_GREEN, string);
                GivePlayerGrana(playerid, - quantidade);
                return 1;
            }
            if(quantidade + dini_Int(f0D
            if(quantidade + dini_Int(file, "Combustivel")){
                new quantia;
                quantia = 100 - dini_Int(file, "Combustivel");
                dini_IntSet(file, "Combustivel", 100);
                format(string, sizeof(string), "(INFO) Pronto tanque cheio foram colocados %d litros.", quantia);
                SendClientMessage(playerid, COLOR_GREEN, string);
                GivePlayerGrana(playerid, - quantia);
                return 1;
            }
        }else{
            SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo estб no posto.");//quando nгo estiver na area
            return 1;
        }
    }

    if(strcmp(cmd,"/entregarcarga",true) == 0)
    {
        if( !IsPlayerInPlace( playerid, 1704.3691, 2332.8310, 10.5472 ))
        {
            SendClientMessage( playerid, Vermelho, "[ x ] Vocк nгo estб na area de carregamento !" );
            return true;
        }
        if(CargaCaminhao[playerid] == 0)
        {
            SendClientMessage(playerid,Vermelho,"[ERRO] Seu veнculo nгo estб com a carga!");
            return true;
        }
        if(AreaEntrega[playerid] == 1)
        {
            SendClientMessage(playerid,COLOR_GREEN,"(INFO) Sua carga foi entregada e vocк ganhou R$: 1.500,00 reais.");
            GivePlayerGrana(playerid,1500);
            CargaCaminhao[playerid] = 1;
            return true;
        }
        else
        {
            SendClientMessage(playerid, "Vermelho", "[ERRO] Vocк nгo estб na area de entrega de carga de caminhгo.");
            return true;
        }
    }
Uma dica tente identar seus codigos ^^

https://sampforum.blast.hk/showthread.php?tid=361455
Reply


Messages In This Thread
Carregamento - by ZaturN - 30.12.2013, 11:07
Re: Carregamento - by cantiliano - 30.12.2013, 11:37
Re: Carregamento - by ZaturN - 30.12.2013, 11:41
Re: Carregamento - by cantiliano - 30.12.2013, 11:42
Re: Carregamento - by ZaturN - 30.12.2013, 11:49
Re: Carregamento - by cantiliano - 30.12.2013, 11:50
Re: Carregamento - by ZaturN - 30.12.2013, 11:55

Forum Jump:


Users browsing this thread: 1 Guest(s)