PHP код:
stock CarregarCarros(playerid)
{
new string[34], file[100];
format(file, 74, "Concessionaria/%s.txt", pName[playerid]);
if(DOF2_FileExists(file))
{
for(new i = 0; i < MAX_PLAYERCAR; i++)
{
format(string, sizeof(string), "TemCarro_%d", i);
ConceInfo[playerid][i][vTemCarro] = DOF2_GetInt(file, string);
format(string, sizeof(string), "Modelo_%d", i);
ConceInfo[playerid][i][vModel] = DOF2_GetInt(file, string);
format(string, sizeof(string), "Cor1_%d", i);
ConceInfo[playerid][i][vColorOne] = DOF2_GetInt(file, string);
format(string, sizeof(string), "Cor2_%d", i);
ConceInfo[playerid][i][vColorTwo] = DOF2_GetInt(file, string);
format(string, sizeof(string), "CarroX_%d", i);
ConceInfo[playerid][i][vLocal][0] = DOF2_GetFloat(file, string);
format(string, sizeof(string), "CarroY_%d", i);
ConceInfo[playerid][i][vLocal][1] = DOF2_GetFloat(file, string);
format(string, sizeof(string), "CarroZ_%d", i);
ConceInfo[playerid][i][vLocal][2] = DOF2_GetFloat(file, string);
format(string, sizeof(string), "CarroA_%d", i);
ConceInfo[playerid][i][vAngle] = DOF2_GetFloat(file, string);
if(ConceInfo[playerid][i][vTemCarro] == 1)
{
ConceInfo[playerid][i][vehicleconce] = CreateVehicle(ConceInfo[playerid][i][vModel],
ConceInfo[playerid][i][vLocal][0], ConceInfo[playerid][i][vLocal][1], ConceInfo[playerid][i][vLocal][2],
ConceInfo[playerid][i][vAngle], ConceInfo[playerid][i][vColorOne], ConceInfo[playerid][i][vColorTwo], -1);
SetVehicleVirtualWorld(ConceInfo[playerid][i][vehicleconce], 0);
LinkVehicleToInterior(ConceInfo[playerid][i][vehicleconce], 0);
}
}
}
return 1;
}
// Cуdigo quando o cara vai comprar o carro na concessionaria
if(ConceInfo[playerid][0][vTemCarro] == 0)
{
ConceInfo[playerid][0][vehicleconce] = CreateVehicle(GetPVarInt(playerid, "idcarro_conce"), 2148.0720, -1143.0665, 25.0160, -90.0000, GetPVarInt(playerid, "id_cor_conce"), GetPVarInt(playerid, "id_cor_conce"), -1);
PutPlayerInVehicle(playerid, ConceInfo[playerid][0][vehicleconce], 0);
SetVehicleVirtualWorld(ConceInfo[playerid][0][vehicleconce], randomMundo);
}
else
{
if(PlayerInfo[playerid][pVIP] == 1)
{
if(ConceInfo[playerid][1][vTemCarro] == 0)
{
ConceInfo[playerid][1][vehicleconce] = CreateVehicle(GetPVarInt(playerid, "idcarro_conce"), 2148.0720, -1143.0665, 25.0160, -90.0000, GetPVarInt(playerid, "id_cor_conce"), GetPVarInt(playerid, "id_cor_conce"), -1);
PutPlayerInVehicle(playerid, ConceInfo[playerid][1][vehicleconce], 0);
SetVehicleVirtualWorld(ConceInfo[playerid][1][vehicleconce], randomMundo);
}
else if(ConceInfo[playerid][2][vTemCarro] == 0)
{
ConceInfo[playerid][2][vehicleconce] = CreateVehicle(GetPVarInt(playerid, "idcarro_conce"), 2148.0720, -1143.0665, 25.0160, -90.0000, GetPVarInt(playerid, "id_cor_conce"), GetPVarInt(playerid, "id_cor_conce"), -1);
PutPlayerInVehicle(playerid, ConceInfo[playerid][2][vehicleconce], 0);
SetVehicleVirtualWorld(ConceInfo[playerid][2][vehicleconce], randomMundo);
}
else return SendClientMessage(playerid, COLOR_GREY, "Voce atingiu o numero maximo de veiculos que pode ter !");
}
else return SendClientMessage(playerid, COLOR_GREY, "Voce ja tem um veiculo, para comprar outro voce deve ser VIP !");
}