27.06.2018, 00:48
Opa, fiz este codigo aqui rapidinho(nгo compilei) XD
recomendo muito associar os valores a variбveis!
PHP код:
CMD:criarveiculocasa(playerid, params[]);
{
new Pasta[20], CasaID, Modelo, Colors[2], Float:pos[4];
if(sscanf(params, "dddd", CasaID, Modelo, Colors[0], Colors[1])) return SendClientMessage(playerid, -1, "| ERRO | Use: /criarveiculocasa [CasaID] [Modelo] [COR1] [COR2]");
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
format(Pasta, sizeof Pasta, "Casas/Casa%d.ini", CasaID);
if(!DOF2::Exists(Pasta)) return SendClientMessage(playerid, -1, "| ERRO | Casa nгo existe!");
format(Pasta, sizeof Pasta, "VeiculosCasas/Casa%d.ini", CasaID);
DOF2::CreateFile(Pasta);
DOF2::SetInt(Pasta, "ID", Modelo);
DOF2::SetInt(Pasta, "Cor1", Colors[0]);
DOF2::SetInt(Pasta, "Cor2", Colors[1]);
DOF2::SetFloat(Pasta, "X", pos[0]);
DOF2::SetFloat(Pasta, "Y", pos[1]);
DOF2::SetFloat(Pasta, "Z", pos[2]);
DOF2::SetFloat(Pasta, "A", pos[3]);
DOF2::SaveFile();
CreateVehicle(Modelo, pos[0], pos[1], pos[2], pos[3], Colors[0], Colors[1], 0);
SendClientMessage(playerid, -1, "Vocк criou o carro!");
return 1;
}
PHP код:
enum Carros
{
Model,
Float:X,
Float:Y,
Float:Z,
Float:A,
Color1,
Color2
}
new CasaCarros[MAX_CASAS][Carros];