enum InformacoesPreco
{
ConceModeloCar,
ConcePreco
};
static ConcePrecos[][InformacoesPreco] = //Tentei Static pra ver se resolve e nd.
{
{400,40000},
{401,23000},
{402,24000},
{404,26000},
{405,21000},
{410,15000},
{411,190000},
{412,40000},
{415,42000},
{418,21000}, //21000 й o preзo de cada modelo, daqui pra baixo estб 21000 pois nгo terminei de colocar os preзo
{419,21000},
{421,21000},
{422,21000},
{424,21000},
{426,21000},
{429,21000},
{431,21000},
{436,21000},
{439,21000},
{442,21000},
{444,21000},
{445,21000},
{451,21000},
{457,21000},
{458,21000},
{461,21000},
{462,21000},
{463,21000},
{466,21000},
{467,21000},
{468,21000},
{471,21000},
{474,21000},
{475,21000},
{477,21000},
{478,21000},
{479,21000},
{480,21000},
{481,21000},
{483,21000},
{491,21000},
{492,21000},
{494,21000},
{495,21000},
{496,21000},
{500,21000},
{502,21000},
{503,21000},
{504,21000},
{505,21000},
{506,21000},
{507,21000},
{508,21000},
{509,21000},
{510,21000},
{515,21000},
{516,21000},
{517,21000},
{518,21000},
{521,21000},
{522,21000},
{526,21000},
{527,21000},
{530,21000},
{534,21000},
{535,21000},
{536,21000},
{540,21000},
{541,21000},
{542,21000},
{543,21000},
{545,21000},
{546,21000},
{547,21000},
{549,21000},
{550,21000},
{551,21000},
{554,21000},
{555,21000},
{556,21000},
{557,21000},
{558,21000},
{559,21000},
{560,21000},
{561,21000},
{562,21000},
{565,21000},
{566,21000},
{567,21000},
{568,21000},
{575,21000},
{576,21000},
{579,21000},
{581,21000},
{585,21000},
{587,21000},
{589,21000},
{600,21000},
{602,21000},
{603,21000}
};
//// LISTA mselection
if(listid == ListaConcessionaria)
{
if(response)
{
new vehicleid;
format(String, sizeof(String), "CarrosConce/%s.ini", PlayerName(playerid));
if(!DOF2_FileExists(String))
{
if(GetPlayerBLH(playerid) >= ConcePrecos[vehicleid][ConcePreco])
{
ComprouVeiculo(playerid, ConcePrecos[vehicleid][ConceModeloCar], ConcePrecos[vehicleid][ConcePreco]);
}
else SendClientMessage(playerid, VERMELHO, "Vocк nгo tem dinheiro suficiente!");
}
else SendClientMessage(playerid, VERMELHO, "Vocк jб possui um veнculo concessionбria!");
}
}
new ConcePrecos[NumerodeVeiculos][InformacoesPreco] = //NumerodeVeiculos vocк coloca o tanto de veiculso q tem aqui!
{
{400,40000},
{401,23000},
{402,24000},
{404,26000},
{405,21000},
{410,15000},
{411,190000},
{412,40000},
{415,42000},
{418,21000}, //21000 й o preзo de cada modelo, daqui pra baixo estб 21000 pois nгo terminei de colocar os preзo
{419,21000},
{421,21000},
{422,21000},
{424,21000},
{426,21000},
{429,21000},
{431,21000},
{436,21000},
{439,21000},
{442,21000},
{444,21000},
{445,21000},
{451,21000},
{457,21000},
{458,21000},
{461,21000},
{462,21000},
{463,21000},
{466,21000},
{467,21000},
{468,21000},
{471,21000},
{474,21000},
{475,21000},
{477,21000},
{478,21000},
{479,21000},
{480,21000},
{481,21000},
{483,21000},
{491,21000},
{492,21000},
{494,21000},
{495,21000},
{496,21000},
{500,21000},
{502,21000},
{503,21000},
{504,21000},
{505,21000},
{506,21000},
{507,21000},
{508,21000},
{509,21000},
{510,21000},
{515,21000},
{516,21000},
{517,21000},
{518,21000},
{521,21000},
{522,21000},
{526,21000},
{527,21000},
{530,21000},
{534,21000},
{535,21000},
{536,21000},
{540,21000},
{541,21000},
{542,21000},
{543,21000},
{545,21000},
{546,21000},
{547,21000},
{549,21000},
{550,21000},
{551,21000},
{554,21000},
{555,21000},
{556,21000},
{557,21000},
{558,21000},
{559,21000},
{560,21000},
{561,21000},
{562,21000},
{565,21000},
{566,21000},
{567,21000},
{568,21000},
{575,21000},
{576,21000},
{579,21000},
{581,21000},
{585,21000},
{587,21000},
{589,21000},
{600,21000},
{602,21000},
{603,21000}
};
PHP код:
|
if(listid == ListaConcessionaria)
{
if(response)
{
new index = -1;
for(new i = 0; i < sizeof(ConcePrecos); i++)
{
if(ConcePrecos[i][ConceModeloCar] == modelid)
{
index = i;
break;
}
}
if(index == -1) return 0;
format(String, sizeof(String), "CarrosConce/%s.ini", PlayerName(playerid));
if(!DOF2_FileExists(String))
{
if(GetPlayerBLH(playerid) >= ConcePrecos[index][ConcePreco])
{
ComprouVeiculo(playerid, ConcePrecos[index][ConceModeloCar], ConcePrecos[index][ConcePreco]);
}
else SendClientMessage(playerid, VERMELHO, "Vocк nгo tem dinheiro suficiente!");
}
else SendClientMessage(playerid, VERMELHO, "Vocк jб possui um veнculo concessionбria!");
}
}
Linha Modelo Preзo 0 400 40000 1 401 23000 2 402 24000