30.07.2016, 17:29
Hello , I have a vehicle in y_ini System that saves the id of the vehicle to the player when buying.
The problem is this , if I am owner of the vehicle ID : 2 and rottamo the vehicle by deleting it from the file and then restart the GM , the IDs of the climbing vehicle 1 from the id of the scrapped vehicle then change can be also owner of a another vehicle , how do I set the id of the vehicle to the player and save it ?
ES :
ID 1 - For Sale
ID 2 - Owner
ID 3 - Police Car
If I, who am the owner of the id 2 , rottamo the vehicle so as to delete the files and 2.ini for a reason x restarts the GM , the vehicle with the iID 1 remains for sale and the vehicle with the ID 3 ID becomes 2 because it is empty so you can see someone who will buy a police vehicle, how do I fix ?
ONGAMEMODEINIT
DIALOG WHEN A PLAYER BUY THE VEHICLE
Sorry for my English but I'm Italian
The problem is this , if I am owner of the vehicle ID : 2 and rottamo the vehicle by deleting it from the file and then restart the GM , the IDs of the climbing vehicle 1 from the id of the scrapped vehicle then change can be also owner of a another vehicle , how do I set the id of the vehicle to the player and save it ?
ES :
ID 1 - For Sale
ID 2 - Owner
ID 3 - Police Car
If I, who am the owner of the id 2 , rottamo the vehicle so as to delete the files and 2.ini for a reason x restarts the GM , the vehicle with the iID 1 remains for sale and the vehicle with the ID 3 ID becomes 2 because it is empty so you can see someone who will buy a police vehicle, how do I fix ?
Quote:
enum vInfo { vProprieta, vProprietario[MAX_PLAYER_NAME], vPrezzo, vModello, vTipo, vFazione, Float:vSpawnA, Float:vSpawnX, Float:vSpawnY, Float:vSpawnZ, Float:vVita, vArma1, vMunizioni1, vArma2, vMunizioni2, vBenzina, vColore1, vColore2, vTarga, vDoor, vLights, vPanels, vTires } new VeicoloInfo[100][vInfo]; |
Quote:
for(new idx5 = 2; idx5 < sizeof(VeicoloInfo); idx5++)//Creates a loop, that goes through all of the businesses. { format(str5, sizeof(str5), VPATH, idx5); INI_ParseFile(str5, "LoadVeh_%s", .bExtra = true, .extra = idx5); if(VeicoloInfo[idx5][vTipo] != 0) { id= GetVehicleFreeSlot( CreateVehicle(VeicoloInfo[idx5][vModello], VeicoloInfo[idx5][vSpawnX],VeicoloInfo[idx5][vSpawnY],VeicoloInfo[idx5][vSpawnZ],VeicoloInfo[idx5][vSpawnA], VeicoloInfo[idx5][vColore2],VeicoloInfo[idx5][vColore2],-1); SetVehicleHealth(idx5, VeicoloInfo[idx5][vVita]); } } |
Quote:
if(VeicoloInfo[GetPlayerVehicleID(playerid)][vTipo] == 1) { new id = GetPlayerVehicleID(playerid); if(id == -1 || id == 0) return SCM(playerid, COMANDO_USARE, "Non sei in un veicolo in vendita"); if(PlayerInfo[playerid][pAuto] > 0) return SCM(playerid, ROSSO, "Hai giа un auto"); if(PlayerInfo[playerid][pCash] < VeicoloInfo[id][vPrezzo]) return SCM(playerid, ROSSO, "Spiacenti, non hai abbastanza soldi."); PlayerInfo[playerid][pAuto] = id; PlayerInfo[playerid][pCash] -= VeicoloInfo[id][vPrezzo]; GivePlayerMoney(playerid, -VeicoloInfo[id][vPrezzo]); VeicoloInfo[id][vProprieta] = 1; VeicoloInfo[id][vProprietario] = RemoveUnderScore(playerid); VeicoloInfo[id][vTipo] = 4; SCM(playerid, COLOR_YELLOW, "Hai acquistato il tuo veicolo,ricordati di parcheggiarlo (/parheggia) subito."); Salvaveh(id); Salvataggio(playerid); |