Problem assigning secondary-key to engine ignition.
#1

Hey there.

I've been messing about with SA:MP servers recently, and I've stumbled upon this problem.

I'm trying to assign the secondary key (2), to turn the engine up and running. The 'starting' part works fine, but when I'm trying to make it shut down, it just starts it -again-

This is what I've got so far:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys & KEY_SUBMISSION && IsPlayerInAnyVehicle(playerid))
    {
        new engine, lights, alarm, doors, bonnet, boot, objective;
        new vid = GetPlayerVehicleID(playerid);

        if(vid != INVALID_VEHICLE_ID)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective);
            GameTextForPlayer(playerid, "~w~Engine: ~g~Started", 3000, 3);
            PlayerPlaySound(playerid, 1053, 0.0, 0.0, 10.0);
        }
        else if (engine == 1)
        {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective);
            GameTextForPlayer(playerid, "~w~Engine: ~r~Stopped", 3000, 3);
            PlayerPlaySound(playerid, 1046, 0.0, 0.0, 10.0);
        }
    }
    return 1;
}
Anyone interested in helping me?
Reply


Messages In This Thread
Problem assigning secondary-key to engine ignition. - by shitbird - 31.03.2011, 19:30
Re: Problem assigning secondary-key to engine ignition. - by Vince - 31.03.2011, 19:42
Re: Problem assigning secondary-key to engine ignition. - by shitbird - 31.03.2011, 19:54
Re: Problem assigning secondary-key to engine ignition. - by Vince - 31.03.2011, 20:37
Re: Problem assigning secondary-key to engine ignition. - by shitbird - 31.03.2011, 20:47

Forum Jump:


Users browsing this thread: 1 Guest(s)