Looping in a command
#2

You can put the rest code to OnDialogResponse, where you cange the variable escolhacombustivel to 1.

I mean like this.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1069)
    {
        if(response) // Escolher
        {
            // Set the variable to 1
            escolhacombustivel[playerid] = 1;

            // The rest code
            if(tipocombustivel[playerid] == 2)
            {
                precoveiculo *= 1.1;
            }

            SendClientMessage(playerid, COLOR_GREY, "========================================================================================================");
            SendClientMessage(playerid, COLOR_WHITE, "Compraste o veiculo com sucesso. Este aparecerб na marinha de Palomino Creek em 10 horas ingame");
            SendClientMessage(playerid, COLOR_GREY, "========================================================================================================");

            SetTimerEx("buyvehtime", 2000, false, "iii", playerid, TCarModel, c);
           
            if(PlayerInfo[playerid][pVipActive] != 0)
            {
                GivePlayerEuros(playerid, -precoveiculo/2);
                Businesses[i][Products]=Businesses[i][Products]-(precoveiculo/2/100);
                Businesses[i][Till]+=precoveiculo;
                OnPlayerDataSave(playerid);
            }
            else
            {
                GivePlayerEuros(playerid, -precoveiculo);
                Businesses[i][Products]=Businesses[i][Products]-(precoveiculo/100);
                Businesses[i][Till]+=precoveiculo;
            }

            if(PlayerInfo[playerid][pChave1] == 255)
            {
                PlayerInfo[playerid][pChave1] = c+1;
                return 1;
            }
            else if(PlayerInfo[playerid][pChave2] == 255)
            {
                PlayerInfo[playerid][pChave2] = c+1;
                return 1;
            }
            else if(PlayerInfo[playerid][pChave3] == 255)
            {
                PlayerInfo[playerid][pChave3] = c+1;
                return 1;
            }
            else if(PlayerInfo[playerid][pChave4] == 255)
            {
                PlayerInfo[playerid][pChave4] = c+1;
                return 1;
            }
            else if(PlayerInfo[playerid][pChave5] == 255)
            {
                PlayerInfo[playerid][pChave5] = c+1;
                return 1;
            }
            else if(PlayerInfo[playerid][pChave6] == 255)
            {
                PlayerInfo[playerid][pChave6] = c+1;
                return 1;
            }
        }
        else // Cancelar
        {

        }
        return 1;
    }
 
    return 0;
}
Reply


Messages In This Thread
Looping in a command - by GunZsmd - 13.05.2016, 17:07
Re: Looping in a command - by Skimmer - 13.05.2016, 17:26
Re: Looping in a command - by GunZsmd - 13.05.2016, 17:55

Forum Jump:


Users browsing this thread: 1 Guest(s)