[HELP] Engine Car
#1

I try to make an engine sistem...but doesn't work.... :




pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    //--------------------
    if ((newkeys==KEY_LOOK_BEHIND))
    {
        if(Engine[vehicleid] == 0)
        {
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
                GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
                SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine >{FFFFFF} ON");
                Engine[Vehicle] = 1, SetVehicleParamsEx(Vehicle, 1, lights, alarm, doors, bonnet, boot, objective);
            }
        }
    }
    else
    {
         if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine >{FFFFFF} OFF");
            Engine[Vehicle] = 0, SetVehicleParamsEx(Vehicle, 0, lights, alarm, doors, bonnet, boot, objective);
        }
    }
    if ((newkeys==KEY_NO))
    {
        if(Lights[vehicleid] == 0)
        {
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
                GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
                SendClientMessage(playerid, COLOR_YELLOW, "You have turned your lights >{FFFFFF} ON");
                Lights[Vehicle] = 1, SetVehicleParamsEx(Vehicle, engine, 1, alarm, doors, bonnet, boot, objective);
            }
        }
    }
    else
    {
         if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, COLOR_YELLOW, "You have turned your lights >{FFFFFF} OFF");
            Lights[Vehicle] = 0, SetVehicleParamsEx(Vehicle, engine, 0, alarm, doors, bonnet, boot, objective);
        }
    }
    return 0;
}
Reply


Messages In This Thread
[HELP] Engine Car - by monster010 - 02.02.2015, 22:46
Re: [HELP] Engine Car - by StarsCream_Cze - 02.02.2015, 23:23
Re: [HELP] Engine Car - by zPain - 03.02.2015, 01:47

Forum Jump:


Users browsing this thread: 2 Guest(s)