pawn Код:
#include <a_Samp>
#include <DOF2>
#define PASTA_CONCE "/Conce/%.ini"
#define MAX_VEHICLE_VIP 10
enum pIConce
{
Modelo,
Float:pX,
Float:pY,
Float:pZ,
Float:pA,
Dono[24],
Placa[15],
Cor1,
Cor2
};
new vConce[MAX_VEHICLE_VIP][pIConce];
stock CriaveiculoConce(playerid)
{
new pName[MAX_PLAYER_NAME], file[100],file2[100], proximov;
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONCE, pName,proximov);
if(DOF2::FileExists(file))
{
proximov++;
DOF2::CreateFile(file);
}
format(file2, sizeof(file2), PASTA_CONCE, pName,proximov);
DOF2::CreateFile(file2);
{
format(placa, sizeof(placa),"BCL - %d", Placas[randPlaca]);
vConce[playerid][Modelo] = ModeloConceVeiculo[playerid];
DOF2::SetInt(file,"Modelo", vConce[playerid][Modelo]);
vConce[playerid][pX] = RequestConceSf[rand][0];
DOF2::SetFloat(file,"pX",vConce[playerid][pX]);
vConce[playerid][pY] = RequestConceSf[rand][1];
DOF2::SetFloat(file,"pY",vConce[playerid][pY]);
vConce[playerid][pZ] = RequestConceSf[rand][2];
DOF2::SetFloat(file,"pZ",vConce[playerid][pZ]);
vConce[playerid][pA] = RequestConceSf[rand][3];
DOF2::SetFloat(file,"pA",vConce[playerid][pA]);
vConce[playerid][Dono] = pName;
DOF2::SetString(file,"Dono",vConce[playerid][Dono]);
vConce[playerid][Placa] = placa;
DOF2::SetString(file,"Placa", placa);
vConce[playerid][Preco] = vVeiculo(ModeloConceVeiculo[playerid]) / 2;
DOF2::SetInt(file,"Preco",vConce[playerid][Preco]);
vConce[playerid][Cor1] = random(128);
DOF2::SetInt(file,"Cor1",vConce[playerid][Cor1]);
vConce[playerid][Cor2] = random(128);
DOF2::SetInt(file,"Cor2",vConce[playerid][Cor2]);
vConce[playerid][Modelo] = CreateVehicle(vConce[playerid][Modelo],vConce[playerid][pX],vConce[playerid][pY],vConce[playerid][pZ],vConce[playerid][pA],vConce[playerid][Cor1],vConce[playerid][Cor2],-1);
SetVehicleNumberPlate(vConce[playerid][Modelo], vConce[playerid][Placa]);
PutPlayerInVehicle(playerid, vConce[playerid][Modelo], 0);
GivePlayerGrana(playerid, -vVeiculo(ModeloConceVeiculo[playerid]));
SendClientMessage(playerid, Verde, "Veiculo Comprado.");
ModeloConceVeiculo[playerid] = 0;
}
return 1;
}