SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/04/2016, 12:00 PM   #1
bero1711
Little Clucker
 
Join Date: Jul 2009
Location: Croatia,Koprivnica
Posts: 20
Reputation: 0
Post [Help]Double cars

Hi! When i put any vehicle in OnGameModeInit() this vehicle spawn double! Here is code...
Code:
CreateVehicle(550,2038.4611,-2071.0376,13.3841,203.1121,42,42,-1,0);
bero1711 is offline   Reply With Quote
Old 09/04/2016, 12:02 PM   #2
Xabi
Big Clucker
 
Xabi's Avatar
 
Join Date: Nov 2012
Posts: 145
Reputation: 6
Default Respuesta: [Help]Double cars

Show the complete code, as using that only once doesn't spawn two cars. This means you're calling it twice.
Xabi is offline   Reply With Quote
Old 09/04/2016, 12:03 PM   #3
bero1711
Little Clucker
 
Join Date: Jul 2009
Location: Croatia,Koprivnica
Posts: 20
Reputation: 0
Default Re: [Help]Double cars

I can show you whole script than :S

This is OnGameModeInit:
Code:
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...

Last edited by bero1711; 09/04/2016 at 12:38 PM.
bero1711 is offline   Reply With Quote
Old 09/04/2016, 01:14 PM   #4
bero1711
Little Clucker
 
Join Date: Jul 2009
Location: Croatia,Koprivnica
Posts: 20
Reputation: 0
Default Re: [Help]Double cars

This was stupid!
In my gamemode was
Code:
main();
but it have to be
Code:
main(){}
bero1711 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help [Script deleting cars owned cars] TheBlaze243 Scripting Help 4 27/06/2014 06:13 PM
Saving Modded Cars (Tuned-up Cars) Lemonaidz Scripting Help 4 22/02/2013 12:21 PM
Double LVHQ With Cars and Multiple Streamers Included v2 Now With Auto Gates SlashPT Filterscripts 10 22/02/2010 04:02 PM
Tuned cars --after respawn--> normal cars Edna Krabapel Help Archive 8 31/01/2010 06:52 PM
Give all cars in OnGameModeInit Components (Tune all cars) RyDeR` Help Archive 4 05/10/2009 04:37 PM


All times are GMT. The time now is 08:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.