Adding cars for factions
#1

how can i add cars for some of my factions? im using raven's roleplay v2.5 atm
Reply
#2

help please
Reply
#3

Can anyone help me please?
Reply
#4

After a quick look through the script, it looks very much like your run of the mill GF edit, so adding faction cars will not be very simple for a beginner.

Since I guess you do not want to count hundreds of lines of messy code, we will create a variable to store the new vehicle's vehicleid.

What you have to do is store the vehicleid of the new faction car you want to add in some variable like so:

Код:
OnGameModeInit(){
    ...
	AddStaticVehicleEx(463,694.8008,-470.2188,15.8761,88.6982,114,114,30000); // Freeway 7
	AddStaticVehicleEx(463,694.9393,-473.1948,15.8766,94.6246,114,114,30000); // Freeway 8
	AddStaticVehicleEx(463,708.5647,-467.8399,15.8754,271.5996,114,114,30000); // Freeway 9
	AddStaticVehicleEx(463,708.6929,-470.7145,15.8735,268.4506,114,114,30000); // Freeway 10

    factionCar1 = AddStaticVehicleEx(463,708.6929,-470.7145,15.8735,268.4506,114,114,30000); // New LA Vice car we are adding, yay!
}
and then edit the function that corresponds to which faciton you are adding the car to so they can use it exclusively (we are giving this car to faction 5 [aka LA Vice]).

Код:
public IsAGangCar5(carid)
{
	if((carid >= 17 && carid <= 18) || (carid == 44) || (carid == 134) || (carid == 1359) || (carid == factionCar1) ) // we edited this line
	{
		return 1;
	}
	return 0;
}
Hope that helps.
Reply
#5

Quote:
Originally Posted by ledzep
After a quick look through the script, it looks very much like your run of the mill GF edit, so adding faction cars will not be very simple for a beginner.

Since I guess you do not want to count hundreds of lines of messy code, we will create a variable to store the new vehicle's vehicleid.

What you have to do is store the vehicleid of the new faction car you want to add in some variable like so:

Код:
OnGameModeInit(){
    ...
	AddStaticVehicleEx(463,694.8008,-470.2188,15.8761,88.6982,114,114,30000); // Freeway 7
	AddStaticVehicleEx(463,694.9393,-473.1948,15.8766,94.6246,114,114,30000); // Freeway 8
	AddStaticVehicleEx(463,708.5647,-467.8399,15.8754,271.5996,114,114,30000); // Freeway 9
	AddStaticVehicleEx(463,708.6929,-470.7145,15.8735,268.4506,114,114,30000); // Freeway 10

    factionCar1 = AddStaticVehicleEx(463,708.6929,-470.7145,15.8735,268.4506,114,114,30000); // New LA Vice car we are adding, yay!
}
and then edit the function that corresponds to which faciton you are adding the car to so they can use it exclusively (we are giving this car to faction 5 [aka LA Vice]).

Код:
public IsAGangCar5(carid)
{
	if((carid >= 17 && carid <= 18) || (carid == 44) || (carid == 134) || (carid == 1359) || (carid == factionCar1) ) // we edited this line
	{
		return 1;
	}
	return 0;
}
Hope that helps.
why faction AddStaticVehicleEx ? i always use AddStaticVehicle !
i think your faction will auto tune car!
Reply
#6

I'm just trying to keep the code looking uniform.

I agree. I myself would use CreateVehicle just because I like the option of being able to destroy any car I want.
Reply
#7

Quote:
Originally Posted by ledzep
After a quick look through the script, it looks very much like your run of the mill GF edit, so adding faction cars will not be very simple for a beginner.

Since I guess you do not want to count hundreds of lines of messy code, we will create a variable to store the new vehicle's vehicleid.

What you have to do is store the vehicleid of the new faction car you want to add in some variable like so:

Код:
OnGameModeInit(){
    ...
	AddStaticVehicleEx(463,694.8008,-470.2188,15.8761,88.6982,114,114,30000); // Freeway 7
	AddStaticVehicleEx(463,694.9393,-473.1948,15.8766,94.6246,114,114,30000); // Freeway 8
	AddStaticVehicleEx(463,708.5647,-467.8399,15.8754,271.5996,114,114,30000); // Freeway 9
	AddStaticVehicleEx(463,708.6929,-470.7145,15.8735,268.4506,114,114,30000); // Freeway 10

    factionCar1 = AddStaticVehicleEx(463,708.6929,-470.7145,15.8735,268.4506,114,114,30000); // New LA Vice car we are adding, yay!
}
and then edit the function that corresponds to which faciton you are adding the car to so they can use it exclusively (we are giving this car to faction 5 [aka LA Vice]).

Код:
public IsAGangCar5(carid)
{
	if((carid >= 17 && carid <= 18) || (carid == 44) || (carid == 134) || (carid == 1359) || (carid == factionCar1) ) // we edited this line
	{
		return 1;
	}
	return 0;
}
Hope that helps.
can you explain these numbers: factionCar1 = AddStaticVehicleEx(463,708.6929,-470.7145,15.8735,268.4506,114,114,30000);
463 is model is then the three next is coordinates or?

also
got
some errors
Код:
C:\Documents and Settings\Martin\Skrivebord\gta server ftw\ser 0.3\gamemodes\larp.pwn(5463) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Martin\Skrivebord\gta server ftw\ser 0.3\gamemodes\larp.pwn(5463) : error 017: undefined symbol "factionCar1"
C:\Documents and Settings\Martin\Skrivebord\gta server ftw\ser 0.3\gamemodes\larp.pwn(5463 -- 5465) : error 001: expected token: "}", but found "return"
C:\Documents and Settings\Martin\Skrivebord\gta server ftw\ser 0.3\gamemodes\larp.pwn(5463 -- 5465) : fatal error 107: too many error messages on one line
heres the code i cahnged/added
Код:
public IsAGangCar2(carid)
{
if(carid >= 97 && carid <= 99) || (carid == factionCar1)
	{
		return 1;
	}
	return 0;
}
and
Код:
	    factionCar1 = AddStaticVehicleEx(451,1246.77,-803.84.14,15.8735,268.4506,114,114,30000); // turismo
Reply
#8

AddStaticVehicleEx @ WIKI
Reply
#9

But i got some errors
Код:
C:\Documents and Settings\Martin\Skrivebord\gta server ftw\ser 0.3\gamemodes\larp.pwn(5463) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Martin\Skrivebord\gta server ftw\ser 0.3\gamemodes\larp.pwn(5463) : error 017: undefined symbol "factionCar1"
C:\Documents and Settings\Martin\Skrivebord\gta server ftw\ser 0.3\gamemodes\larp.pwn(5463 -- 5465) : error 001: expected token: "}", but found "return"
C:\Documents and Settings\Martin\Skrivebord\gta server ftw\ser 0.3\gamemodes\larp.pwn(5463 -- 5465) : fatal error 107: too many error messages on one line
heres the code i cahnged/added
Код:
public IsAGangCar2(carid)
{
if(carid >= 97 && carid <= 99) || (carid == factionCar1)
	{
		return 1;
	}
	return 0;
}
and
Код:
	    factionCar1 = AddStaticVehicleEx(451,1246.77,-803.84.14,15.8735,268.4506,114,114,30000); // turismo
Reply
#10

Somewhere near the top of your script add:

Код:
new factionCar1;
Your brackets didn't match up:

Код:
public IsAGangCar2(carid)
{
    if((carid >= 97 && carid <= 99) || (carid == factionCar1))
	{
		return 1;
	}
	return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)