Hi! When i put any vehicle in OnGameModeInit() this vehicle spawn double! Here is code...
Show the complete code, as using that only once doesn't spawn two cars. This means you're calling it twice.
Код:
public OnGameModeInit()
{
CreateMyObjects();
SetTimer("SecondTimerGlobal", 1000, 1);
SetGameModeText("SlicK");
UsePlayerPedAnims();
AddPlayerClass(3, 1172.6287,-1323.5090,15.4028,268.2801, 0, 0, 0, 0, 0, 0);
//_________________________________Ownership 3D_________________________________
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Lowrider\nautosalon\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[0][0],VehShopLoc[0][1],VehShopLoc[0][2], 20);
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Wang\nautosalon\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[1][0],VehShopLoc[1][1],VehShopLoc[1][2], 20);
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Unique\nautosalon\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[2][0],VehShopLoc[2][1],VehShopLoc[2][2], 20);
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Wagos\nautosalon\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[3][0],VehShopLoc[3][1],VehShopLoc[3][2], 20);
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Offroad\nautosalon\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[4][0],VehShopLoc[4][1],VehShopLoc[4][2], 20);
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Convertibles\nautosalon\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[5][0],VehShopLoc[5][1],VehShopLoc[5][2], 20);
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Sport\nautosalon\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[6][0],VehShopLoc[6][1],VehShopLoc[6][2], 20);
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Salon\nmotora\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[7][0],VehShopLoc[7][1],VehShopLoc[7][2], 20);
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Ducan\nbiciklima\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[8][0],VehShopLoc[8][1],VehShopLoc[8][2], 20);
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Prodaja\nletjelica\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[9][0],VehShopLoc[9][1],VehShopLoc[9][2], 20);
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Brodarica\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[10][0],VehShopLoc[10][1],VehShopLoc[10][2], 20);
CreateDynamic3DTextLabel(""COL_OWNERSHIP"Ducan RC\nvozilima\n"COL_WHITE"Koristi /kupivozilo", 0xFFFFFFFF, VehShopLoc[11][0],VehShopLoc[11][1],VehShopLoc[11][2], 20);
//______________________________Ownership Pickups_______________________________
Pickup_Ownership[0] = CreateDynamicPickup(1083,1,VehShopLoc[0][0],VehShopLoc[0][1],VehShopLoc[0][2],0);
Pickup_Ownership[1] = CreateDynamicPickup(1083,1,VehShopLoc[1][0],VehShopLoc[1][1],VehShopLoc[1][2],0);
Pickup_Ownership[2] = CreateDynamicPickup(1083,1,VehShopLoc[2][0],VehShopLoc[2][1],VehShopLoc[2][2],0);
Pickup_Ownership[3] = CreateDynamicPickup(1083,1,VehShopLoc[3][0],VehShopLoc[3][1],VehShopLoc[3][2],0);
Pickup_Ownership[4] = CreateDynamicPickup(1083,1,VehShopLoc[4][0],VehShopLoc[4][1],VehShopLoc[4][2],0);
Pickup_Ownership[5] = CreateDynamicPickup(1083,1,VehShopLoc[5][0],VehShopLoc[5][1],VehShopLoc[5][2],0);
Pickup_Ownership[6] = CreateDynamicPickup(1083,1,VehShopLoc[6][0],VehShopLoc[6][1],VehShopLoc[6][2],0);
Pickup_Ownership[7] = CreateDynamicPickup(1083,1,VehShopLoc[7][0],VehShopLoc[7][1],VehShopLoc[7][2],0);
Pickup_Ownership[8] = CreateDynamicPickup(1083,1,VehShopLoc[8][0],VehShopLoc[8][1],VehShopLoc[8][2],0);
Pickup_Ownership[9] = CreateDynamicPickup(1083,1,VehShopLoc[9][0],VehShopLoc[9][1],VehShopLoc[9][2],0);
Pickup_Ownership[10] = CreateDynamicPickup(1083,1,VehShopLoc[10][0],VehShopLoc[10][1],VehShopLoc[10][2],0);
Pickup_Ownership[11] = CreateDynamicPickup(1083,1,VehShopLoc[11][0],VehShopLoc[11][1],VehShopLoc[11][2],0);
CreateVehicle(550,2038.4611,-2071.0376,13.3841,203.1121,42,42,-1,0); // wang izlozbeno
//_______________________________Business Load__________________________________
for(new idx = 1; idx < sizeof(BusinessInfo); idx++){
new str[40];
format(str, sizeof(str), BPATH, idx);
INI_ParseFile(str, "loadbiz_%s", .bExtra = true, .extra = idx );
if(fexist(str)) {
BusinessInfo[idx][bEntPick] = CreateDynamicPickup(BIZZ_ENTER_PICK, 1, BusinessInfo[idx][bEntX], BusinessInfo[idx][bEntY], BusinessInfo[idx][bEntZ], 0); //Creates a pickup at the business entrance.
BusinessInfo[idx][bExPick] = CreateDynamicPickup(BIZZ_EXIT_PICK, 1, BusinessInfo[idx][bExX], BusinessInfo[idx][bExY], BusinessInfo[idx][bExZ], BusinessInfo[idx][bVW]);
BusinessInfo[idx][bMap] = CreateDynamicMapIcon(BusinessInfo[idx][bEntX], BusinessInfo[idx][bEntY], BusinessInfo[idx][bEntZ], BusinessInfo[idx][bMapID], 0);
if(BusinessInfo[idx][bOwned] == 1){
new string[256];
format(string, sizeof(string), ""COL_FIRMA"Firma: "COL_WHITE"%s\n"COL_FIRMA"Vrsta:"COL_WHITE" %s\n"COL_FIRMA"Vlasnik:"COL_WHITE" %s\n"COL_FIRMA"Level:"COL_WHITE" %d\n\n"COL_FIRMA"Pritisni "COL_WHITE"'Y'"COL_FIRMA" za\nulaz", BusinessInfo[idx][bName],BusinessType(idx), BusinessInfo[idx][bOwner],BusinessInfo[idx][bLevel]);
Bizz3d[idx] = CreateDynamic3DTextLabel(string, 0xFFFFFFFF, BusinessInfo[idx][bEntX], BusinessInfo[idx][bEntY], BusinessInfo[idx][bEntZ],20);
}
else if(BusinessInfo[idx][bOwned] == 0){
new string[128];
format(string, sizeof(string), ""COL_FIRMA"Firma: "COL_WHITE"%s\n"COL_FIRMA"Vrsta: "COL_WHITE"%s\n"COL_FIRMA"Na prodaju\nLevel: "COL_WHITE"%d\n"COL_FIRMA"Cijena: "COL_WHITE"%d", BusinessInfo[idx][bName], BusinessType(idx), BusinessInfo[idx][bLevel],BusinessInfo[idx][bPrice]);
Bizz3d[idx] = CreateDynamic3DTextLabel(string, 0xFFFFFFFF, BusinessInfo[idx][bEntX], BusinessInfo[idx][bEntY], BusinessInfo[idx][bEntZ], 20);
}
}
}
return 1;
}
EDIT: If i change the mode to new mode in pawno and add vehicle it happends again...