Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SalvarVeiculo(playerid)
- {
- if(IsValidVehicle(CarDono[playerid]))
- {
- // Pegar informações
- static model, color1, color2;
- model = GetVehicleModel(CarDono[playerid]);
- GetVehicleColor(CarDono[playerid], color1, color2);
- static Float:x, Float:y, Float:z, Float:r;
- GetVehiclePos(CarDono[playerid], x, y, z);
- GetVehicleZAngle(CarDono[playerid], r);
- static Float:health;
- GetVehicleHealth(CarDono[playerid], health);
- // Salvar informações
- DOF2_SetInt(PathCarro(playerid), "Model", model);
- DOF2_SetInt(PathCarro(playerid), "Cor1", color1);
- DOF2_SetInt(PathCarro(playerid), "Cor2", color2);
- DOF2_SetFloat(PathCarro(playerid), "PosX", x);
- DOF2_SetFloat(PathCarro(playerid), "PosY", y);
- DOF2_SetFloat(PathCarro(playerid), "PosZ", z);
- DOF2_SetFloat(PathCarro(playerid), "PosR", r);
- DOF2_SetFloat(PathCarro(playerid), "Health", health);
- DOF2_SetFloat(PathCarro(playerid), "Armour", armour);
- DOF2_SaveFile();
- }
- }
- CarregarVeiculo(playerid)
- {
- if(DOF2_FileExists(PathCarro(playerid)))
- {
- // Carregar Dados
- static model, color1, color2;
- model = DOF2_GetInt(PathCarro(playerid), "Model");
- color1 = DOF2_GetInt(PathCarro(playerid), "Cor1");
- color2 = DOF2_GetInt(PathCarro(playerid), "Cor2");
- static Float:x, Float:y, Float:z, Float:r;
- x = DOF2_GetFloat(PathCarro(playerid), "PosX");
- y = DOF2_GetFloat(PathCarro(playerid), "PosY");
- z = DOF2_GetFloat(PathCarro(playerid), "PosZ");
- r = DOF2_GetFloat(PathCarro(playerid), "PosR");
- static Float:health;
- health = DOF2_GetFloat(PathCarro(playerid), "Health");
- // Spawnar Veiculo
- CarDono[playerid] = AddStaticVehicle(model, x, y, z, r, color1, color2);
- SetVehicleHealth(CarDono[playerid], health);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment