if(dialogid == VENDAVEICULOS) { if(response == 1) { new vehicleid = GetPlayerVehicleID(playerid); DOF2_CreateFile(StringVeh); DOF2_SetString(StringVeh, "Dono", Nome(playerid)); DOF2_SetInt(StringVeh, "Preco", 0); DOF2_SetInt(StringVeh, "Nivel", 0); DOF2_SetInt(StringVeh, "Modelo", 411); DOF2_SetFloat(StringVeh, "pVX", 1479.8016); DOF2_SetFloat(StringVeh, "pVY", -1600.4646); DOF2_SetFloat(StringVeh, "pVZ", 13.3747); DOF2_SetFloat(StringVeh, "pVROT", 175.3977); DOF2_SetInt(StringVeh, "Cor1", 0); DOF2_SetInt(StringVeh, "Cor2", 0); DOF2_SetInt(StringVeh, "Tranca", 0); DOF2_SetInt(StringVeh, "Vip", 0); CreateVehicle(Veiculo[vehicleid][pVModelo],Veiculo[vehicleid][pVX],Veiculo[vehicleid][pVY],Veiculo[vehicleid][pVZ],Veiculo[vehicleid][pVROT],Veiculo[vehicleid][pVCor1],Veiculo[vehicleid][pVCor2],false); SendClientMessage(playerid, BRANCO, "{32CD32}Veiculo Criado:{FFFAFA}."); return 1; } if(response == 0) { RemovePlayerFromVehicle(playerid); return 1; } }
enum VeiculoInfo { pVDono[MAX_PLAYER_NAME], pVPreco, pVNivel, pVModelo, Float ![]() Float ![]() Float ![]() Float ![]() pVCor1, pVCor2, pVTranca, pVVip }; new Veiculo[MAX_VEHICLES][VeiculoInfo]; |
for(new i = 0; i < MAX_PLAYERS; i++) { new vehicleid = GetPlayerVehicleID(i); format(StringVeh, sizeof(StringVeh), "Veiculos/%d.ini", vehicleid); if(DOF2_FileExists(StringVeh)) { DOF2_SetString(StringVeh, "Dono", Veiculo[vehicleid][pVDono]); DOF2_SetInt(StringVeh, "Preco", Veiculo[vehicleid][pVPreco]); DOF2_SetInt(StringVeh, "Nivel", Veiculo[vehicleid][pVNivel]); DOF2_SetInt(StringVeh, "Modelo", Veiculo[vehicleid][pVModelo]); DOF2_SetFloat(StringVeh, "pVX", Veiculo[vehicleid][pVX]); DOF2_SetFloat(StringVeh, "pVY", Veiculo[vehicleid][pVY]); DOF2_SetFloat(StringVeh, "pVZ", Veiculo[vehicleid][pVZ]); DOF2_SetFloat(StringVeh, "pVROT", Veiculo[vehicleid][pVROT]); DOF2_SetInt(StringVeh, "Cor1", Veiculo[vehicleid][pVCor1]); DOF2_SetInt(StringVeh, "Cor2", Veiculo[vehicleid][pVCor2]); DOF2_SetInt(StringVeh, "Tranca", Veiculo[vehicleid][pVTranca]); DOF2_SetInt(StringVeh, "Vip", Veiculo[vehicleid][pVVip]); DOF2_SaveFile(); } } |
for(new i = 0; i < MAX_PLAYERS; i++) { new vehicleid = GetPlayerVehicleID(i); format(StringVeh, sizeof(StringVeh), "Veiculos/%d.ini", vehicleid); if(DOF2_FileExists(StringVeh)) { strmid(Veiculo[vehicleid][pVDono], DOF2_GetString(StringVeh, "Dono"), 0, strlen(DOF2_GetString(StringVeh, "Dono")), 255); Veiculo[vehicleid][pVPreco] = DOF2_GetInt(StringVeh, "Preco"); Veiculo[vehicleid][pVNivel] = DOF2_GetInt(StringVeh, "Nivel"); Veiculo[vehicleid][pVModelo] = DOF2_GetInt(StringVeh, "Modelo"); Veiculo[vehicleid][pVX] = DOF2_GetFloat(StringVeh, "pVX"); Veiculo[vehicleid][pVY] = DOF2_GetFloat(StringVeh, "pVY"); Veiculo[vehicleid][pVZ] = DOF2_GetFloat(StringVeh, "pVZ"); Veiculo[vehicleid][pVROT] = DOF2_GetFloat(StringVeh, "pVROT"); Veiculo[vehicleid][pVCor1] = DOF2_GetInt(StringVeh, "Cor1"); Veiculo[vehicleid][pVCor2] = DOF2_GetInt(StringVeh, "Cor2"); Veiculo[vehicleid][pVTranca] = DOF2_GetInt(StringVeh, "Tranca"); Veiculo[vehicleid][pVVip] = DOF2_GetInt(StringVeh, "VIP"); } } |
#define MAX_CARS_PLAYERS 2
// Na hora do Loop
for ( new car; car < MAX_CARS_PLAYERS; ++car )
{
...
}
for(new i; i < MAX_CARS_PLAYERS ; ++ i )
{
format(StringVeh, sizeof ( StringVeh ) , "Carros/%s%d.ini" , PlayerName ( playerid ) , i ) ;
}