Start with Locked Cars
#1

Hello. I'm add the a few cars. I want My Gamemode is started with cars locked. I'm down code is tested but don't started. Sorry my English is bad.

Код:
	{
	new carid;
	new i;
	for (i=0;i<MAX_PLAYERS;i++)
	if (i!=playerid) SetVehicleParamsForPlayer(carid,i,0,1);

	carid=AddStaticVehicle(445,206.3327,1879.3508,17.5193,10.3891,43,43); // Admiral
	carid=AddStaticVehicle(445,197.6916,1877.2139,17.5233,0.9777,45,45); // Admiral
	carid=AddStaticVehicle(445,177.7209,1926.1549,17.9412,180.1315,47,47); // Admiral
	carid=AddStaticVehicle(597,221.1402,1879.6660,17.4089,173.3373,0,1); // Polis Arabası
	carid=AddStaticVehicle(597,229.2434,1878.8076,17.4100,359.0803,0,1); // Polis Arabası
	carid=AddStaticVehicle(421,227.1729,1922.7664,17.3994,359.0645,1,1); // Panzer
	carid=AddStaticVehicle(411,160.1471,1900.9275,18.4369,272.6650,123,1); // İnfernus
	carid=AddStaticVehicle(411,160.1254,1906.6155,18.4409,93.3125,116,1); // İnfernus
	carid=AddStaticVehicle(411,235.0547,1902.7949,17.3677,89.9168,112,1); // İnfernus
	carid=AddStaticVehicle(560,191.7497,1889.0115,17.3460,268.7660,17,1); // Sultan
	carid=AddStaticVehicle(560,192.2230,1892.6212,17.3461,88.4327,21,1); // Sultan
	carid=AddStaticVehicle(487,242.8354,1922.7932,17.8195,131.1399,29,42); // Helikopter
	carid=AddStaticVehicle(487,173.7970,1885.8098,21.0685,177.2696,26,57); // Helikopter
	}
Reply
#2

You're adding this to the wrong place:

Код:
new carid;
	new i;
	for (i=0;i<MAX_PLAYERS;i++)
	if (i!=playerid) SetVehicleParamsForPlayer(carid,i,0,1);
Add this:

Код:
for(carid=0;carid<MAX_PLAYERS;carid++)
SetVehicleParamsForPlayer(carid,playerid,0,1);
to OnPlayerConnect.
Reply
#3

I writed:

Код:
	{
	new carid;
	for(carid=0;carid<MAX_PLAYERS;carid++)
	SetVehicleParamsForPlayer(carid,playerid,0,1);
	carid = AddStaticVehicle(445,206.3327,1879.3508,17.5193,10.3891,43,43); // Admiral
	carid = AddStaticVehicle(445,197.6916,1877.2139,17.5233,0.9777,45,45); // Admiral
	carid = AddStaticVehicle(445,177.7209,1926.1549,17.9412,180.1315,47,47); // Admiral
	carid = AddStaticVehicle(597,221.1402,1879.6660,17.4089,173.3373,0,1); // Polis Arabası
	carid = AddStaticVehicle(597,229.2434,1878.8076,17.4100,359.0803,0,1); // Polis Arabası
	carid = AddStaticVehicle(421,227.1729,1922.7664,17.3994,359.0645,1,1); // Panzer
	carid = AddStaticVehicle(411,160.1471,1900.9275,18.4369,272.6650,123,1); // İnfernus
	carid = AddStaticVehicle(411,160.1254,1906.6155,18.4409,93.3125,116,1); // İnfernus
	carid = AddStaticVehicle(411,235.0547,1902.7949,17.3677,89.9168,112,1); // İnfernus
	carid = AddStaticVehicle(560,191.7497,1889.0115,17.3460,268.7660,17,1); // Sultan
	carid = AddStaticVehicle(560,192.2230,1892.6212,17.3461,88.4327,21,1); // Sultan
	carid = AddStaticVehicle(487,242.8354,1922.7932,17.8195,131.1399,29,42); // Helikopter
	carid = AddStaticVehicle(487,173.7970,1885.8098,21.0685,177.2696,26,57); // Helikopter
	}
But cars not locked.
Reply
#4

Did you not read what I said? Completely get rid of

Код:
	new carid;
	for(carid=0;carid<MAX_PLAYERS;carid++)
	SetVehicleParamsForPlayer(carid,playerid,0,1);
and get rid of "carid = " from the start of all your AddStaticVehicles.

Then write the code I gave you in OnPlayerConnect.
Reply
#5

I already write in OnPlayerConnect. I not want all cars. I want started with locked a few cars.
Reply
#6

Quote:
Originally Posted by lol2112
Did you not read what I said? Completely get rid of

Код:
	new carid;
	for(carid=0;carid<MAX_PLAYERS;carid++)
	SetVehicleParamsForPlayer(carid,playerid,0,1);
and get rid of "carid = " from the start of all your AddStaticVehicles.

Then write the code I gave you in OnPlayerConnect.
Thats locking 200 cars. What if he haves 300? Then he locks 100 too less.
Reply
#7

Sorry MAX_PLAYERS was meant to be MAX_VEHICLES...so use this:

Код:
for(carid=0;carid<MAX_VEHICLES;carid++)
SetVehicleParamsForPlayer(carid,playerid,0,1);
Reply
#8

He just wants these specific cars to be locked
pawn Код:
//top of script
new carid[13];
//under gamemodeinit
carid[0] = AddStaticVehicle(445,206.3327,1879.3508,17.5193,10.3891,43,43); // Admiral
carid[1] = AddStaticVehicle(445,197.6916,1877.2139,17.5233,0.9777,45,45); // Admiral
carid[2] = AddStaticVehicle(445,177.7209,1926.1549,17.9412,180.1315,47,47); // Admiral
carid[3] = AddStaticVehicle(597,221.1402,1879.6660,17.4089,173.3373,0,1); // Polis Arabas?
carid[4] = AddStaticVehicle(597,229.2434,1878.8076,17.4100,359.0803,0,1); // Polis Arabas?
carid[5] = AddStaticVehicle(421,227.1729,1922.7664,17.3994,359.0645,1,1); // Panzer
carid[6] = AddStaticVehicle(411,160.1471,1900.9275,18.4369,272.6650,123,1); // I.nfernus
carid[7] = AddStaticVehicle(411,160.1254,1906.6155,18.4409,93.3125,116,1); // I.nfernus
carid[8] = AddStaticVehicle(411,235.0547,1902.7949,17.3677,89.9168,112,1); // I.nfernus
carid[9] = AddStaticVehicle(560,191.7497,1889.0115,17.3460,268.7660,17,1); // Sultan
carid[10] = AddStaticVehicle(560,192.2230,1892.6212,17.3461,88.4327,21,1); // Sultan
carid[11] = AddStaticVehicle(487,242.8354,1922.7932,17.8195,131.1399,29,42); // Helikopter
carid[12] = AddStaticVehicle(487,173.7970,1885.8098,21.0685,177.2696,26,57); // Helikopter
//under onplayerconnect
for(new a=0;a<13;a++)
{
     SetVehicleParamsForPlayer(carid[a],playerid,0,1);
}
Reply
#9

Quote:
Originally Posted by dice7
He just wants these specific cars to be locked
pawn Код:
//top of script
new carid[13];
//under gamemodeinit
carid[0] = AddStaticVehicle(445,206.3327,1879.3508,17.5193,10.3891,43,43); // Admiral
carid[1] = AddStaticVehicle(445,197.6916,1877.2139,17.5233,0.9777,45,45); // Admiral
carid[2] = AddStaticVehicle(445,177.7209,1926.1549,17.9412,180.1315,47,47); // Admiral
carid[3] = AddStaticVehicle(597,221.1402,1879.6660,17.4089,173.3373,0,1); // Polis Arabas?
carid[4] = AddStaticVehicle(597,229.2434,1878.8076,17.4100,359.0803,0,1); // Polis Arabas?
carid[5] = AddStaticVehicle(421,227.1729,1922.7664,17.3994,359.0645,1,1); // Panzer
carid[6] = AddStaticVehicle(411,160.1471,1900.9275,18.4369,272.6650,123,1); // I.nfernus
carid[7] = AddStaticVehicle(411,160.1254,1906.6155,18.4409,93.3125,116,1); // I.nfernus
carid[8] = AddStaticVehicle(411,235.0547,1902.7949,17.3677,89.9168,112,1); // I.nfernus
carid[9] = AddStaticVehicle(560,191.7497,1889.0115,17.3460,268.7660,17,1); // Sultan
carid[10] = AddStaticVehicle(560,192.2230,1892.6212,17.3461,88.4327,21,1); // Sultan
carid[11] = AddStaticVehicle(487,242.8354,1922.7932,17.8195,131.1399,29,42); // Helikopter
carid[12] = AddStaticVehicle(487,173.7970,1885.8098,21.0685,177.2696,26,57); // Helikopter
//under onplayerconnect
for(new a=0;a<13;a++)
{
     SetVehicleParamsForPlayer(carid[a],playerid,0,1);
}
Thank you. I'm testing...
Reply
#10

Cars is not locked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)