[help] vehicle pramas -
yarrum3 - 06.01.2011
How do i find out if a car engine is on or off
Re: [help] vehicle pramas -
Chrillzen - 06.01.2011
If the engine is off you can't drive, and if it's on you can.
Re: [help] vehicle pramas -
yarrum3 - 06.01.2011
Quote:
Originally Posted by Chrillzen
If the engine is off you can't drive, and if it's on you can.
|
No shit
I want to know like if i do /engine and the VEHICLE_PARAMS are on it wil set them to VEHICLE_PARAMS_OFF
so something like this but i want it for maxplayers right now it just chages a number 1 on any one.
Код:
if(strcmp(x_nr,"engine",true) == 0)
{
new vid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
if(vid != INVALID_VEHICLE_ID)
if(carruning == 0)
{
carruning = 1;
SendClientMessage(playerid,WHITE,"Vehicle {D10000}Engine {11A803}starting,{FFFFFF}please wait.");
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
}
else
{
carruning = 0;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
}
Re: [help] vehicle pramas -
Infamous - 06.01.2011
pawn Код:
// Top of script
new carrunning[MAX_PLAYERS];
// In your function
carruning[playerid] = 1; // or 0 depending on where you are using it.
That will change the variable individually for each player.
Re: [help] vehicle pramas -
yarrum3 - 06.01.2011
OK what if the player was in one car and did the command to turn the car on then he hop into a different car and did the command again will he have to do the command 2 times to turn the car on because the variable will be all reedy set to make it look like the car is on. when the car is relay off. so i need it to get the pramas from each new vehicle i go into
Re: [help] vehicle pramas -
Infamous - 06.01.2011
OnPlayerExitVehicle set it to 0?
Re: [help] vehicle pramas -
yarrum3 - 06.01.2011
that will not help if the car is on and i hop into it. i know it can be done i have Sean it.
Re: [help] vehicle pramas -
Dj_maryo1993 - 06.01.2011
pawn Код:
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine==-1 || engine ==0)
{
printf("The engine is off");
}
if(engine==1)
{
printf("The engine is on");
}
PS : If doesn't work try -1 || 0 engine on and 1 engine of
Same go for the rest of them
For example , here is my truck command :
pawn Код:
COMMAND:truck(playerid, params[])
{
new cid = GetPlayerVehicleID(playerid);
if(cid>0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(cid,engine,lights,alarm,doors,bonnet,boot,objective);
if (boot == -1||boot==0)
{
SetVehicleParamsEx(cid,engine,lights,alarm,doors,bonnet,1,objective);
GameTextForPlayer(playerid,"Backtruck~r~Opened",2000,1);
return 1;
}
if (boot ==1)
{
SetVehicleParamsEx(cid,engine,lights,alarm,doors,bonnet,0,objective);
GameTextForPlayer(playerid,"Backtruck~r~Closed",2000,1);
return 1;
}
}
return 1;
}
(yeah , i know , you can open it if you are a passanger , that's the point)
Re: [help] vehicle pramas -
Infamous - 06.01.2011
Try using this include, it's a tad simpler.
Click Here