One variable for all vehicles question
#1

Hi there,

I am a pretty decent scripter. However, I still have much to learn. For instance, is there a way to create a variable to equal every vehicle?

Okay, like this.


new vehid;

public OnGameModeInit( )
{
vehid = AddStaticVehicle(***,X,Y,Z,color1, color2); //
return 1;
}

public OnPlayerEnterVehicle (playerid, vehicleid)
{
if (vehicleid == vehid)
{
AddVehicleComponent(vehicle, 1010); // Nitro

}
return 1;

I want "***" to equal every vehicle in the game, regardless of coordinates of that model. I am sick of manually putting in line for line coding. It would be nice to cut down on some of my code so my server runs smoother. The server will take care of the rest whether the vehicle is capable of nitrous or not. I want to use this type of system for more than one function so it would really be great if someone can help me. Thanks
Reply
#2

pawn Код:
public OnPlayerEnterVehicle (playerid, vehicleid)
{
AddVehicleComponent(vehicleid, 1010); // Nitro
return 1;
}
Reply
#3

Thank you, but, is a there a way to specify a variable for a certain list?



I may have been unclear on something, every vehicle in the game is supposed to be every vehicle that is under a specific variable.
For instance, I am going to have an area that hosts different events. I have it already scripted and it works fine, however, the vehicles are what I am having a problem with. I want to make all hotrings, Blood Bangers, Monster trucks, and whatever else I feel is necessary for the different events to have nitrous. After I figure this out, I would like to make the health never drop under 500 and if the vehicle ends up flipped, the server automatically flips it back on its wheel without a text-base command. I have different arena's ready to add vehicles to interiors. Some of the interiors already have sanchez's, like the kickstart arena.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)