[HELP] BMX engine - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] BMX engine (
/showthread.php?tid=515289)
[HELP] BMX engine -
monster010 - 25.05.2014
Why doesn't work this script?
pawn Код:
if (newstate == PLAYER_STATE_DRIVER)
{
if (GetVehicleModel(vehicleid) == 481)
{
Engine[vehicle] = 1;
}
}
Re: [HELP] BMX engine -
Vaishnav - 25.05.2014
lol cycles have no engine ._.
Re : [HELP] BMX engine -
S4t3K - 25.05.2014
Because BMX's doesn't have any engine.
You should do
PHP код:
if (newstate == PLAYER_STATE_DRIVER) GetVehicleModel(vehicleid) = 481 ? return 1 : Engine[vehicle] = 1;
Re: [HELP] BMX engine -
monster010 - 25.05.2014
Код:
error 022: must be lvalue (non-constant)
warning 206: redundant test: constant expression is non-zero
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Re : [HELP] BMX engine -
S4t3K - 25.05.2014
Then try this
PHP код:
if(newstate == PLAYER_STATE_DRIVER)
{
if(GeVehicleModel(vehicleid) != 481) Engine[vehicle] = 1;
// Rest of your code if the player state is driver
}
Re: [HELP] BMX engine -
Konstantinos - 25.05.2014
You can turn on/off the engine of a bmx using SetVehicleParamsEx. Setting a variable only will do nothing.
Quote:
Originally Posted by Vaishnav
lol cycles have no engine ._.
|
GTA SA logic.
Re : [HELP] BMX engine -
S4t3K - 25.05.2014
@Konstantinos : He may have gotten the vehicle params in the begining of the callback with GetVehicleParamsEx, and storing the engine to Engine[vehicle], we absolutely don't know about it.
Re: [HELP] BMX engine -
monster010 - 25.05.2014
You help me with this thing, with SetVehicleParamsEx, but still does not work.
Re : [HELP] BMX engine -
S4t3K - 25.05.2014
PHP код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}
Re: [HELP] BMX engine -
monster010 - 25.05.2014
Why is don't work?
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(vehicleid) != 481)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
}