[HELP] BMX engine
#1

Why doesn't work this script?

pawn Код:
if (newstate == PLAYER_STATE_DRIVER)
    {
        if (GetVehicleModel(vehicleid) == 481)
        {
            Engine[vehicle] = 1;
        }
    }
Reply
#2

lol cycles have no engine ._.
Reply
#3

Because BMX's doesn't have any engine.

You should do

PHP код:

if (newstate == PLAYER_STATE_DRIVERGetVehicleModel(vehicleid) = 481 ? return Engine[vehicle] = 1
Reply
#4

Код:
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
Reply
#5

Then try this

PHP код:

if(newstate == PLAYER_STATE_DRIVER)
{
    if(
GeVehicleModel(vehicleid) != 481Engine[vehicle] = 1;
    
// Rest of your code if the player state is driver

Reply
#6

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.
Reply
#7

@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.
Reply
#8

You help me with this thing, with SetVehicleParamsEx, but still does not work.
Reply
#9

PHP код:

public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        new 
vehicleid GetPlayerVehicleID(playerid);
        new 
enginelightsalarmdoorsbonnetbootobjective;
        
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
        
SetVehicleParamsEx(vehicleid1lightsalarmdoorsbonnetbootobjective);
    }
    return 
1;

Reply
#10

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);
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)