Reversing horn
#1

Hey i was making a reversing horn but if i use it its not working... This is my code:
pawn Код:
new Reversing[MAX_PLAYERS];
forward ReverseHorn(playerid,vehicleid);
^ Thats the top ^
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    #define HOLDING(%0) \
    ((newkeys & (%0)) == (%0))

    #define RELEASED(%0) \
    (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

    if (HOLDING(KEY_JUMP) && IsPlayerInAnyVehicle(playerid) && Reversing[playerid] == 0) {
        Reversing[playerid] = 1;
    }
    if (RELEASED(KEY_JUMP)&& IsPlayerInAnyVehicle(playerid)) {
        Reversing[playerid] = 0;
    }
    return 1;
}
^Thats Key state change^
pawn Код:
public ReverseHorn(playerid, vehicleid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    if (Reversing[playerid] == 1) {
        SetVehicleParamsEx(vehicleid, engine, lights, true, doors, bonnet, boot, objective);
    }
    else {

        SetVehicleParamsEx(vehicleid, engine, lights, false, doors, bonnet, boot, objective);
    }
}
This is what it should do but the alarm doesnt go on when driving backwards anyone know how to fix this?
Reply


Messages In This Thread
Reversing horn - by thimo - 02.03.2011, 17:08
Re: Reversing horn - by thimo - 05.03.2011, 10:09
Re: Reversing horn - by thimo - 07.03.2011, 12:21
Re: Reversing horn - by thimo - 11.04.2011, 06:33
Respuesta: Reversing horn - by usrb1n - 11.04.2011, 07:07
Re: Reversing horn - by thimo - 11.04.2011, 07:16
Re: Reversing horn - by Retardedwolf - 11.04.2011, 07:37
Re: Reversing horn - by thimo - 11.04.2011, 07:43

Forum Jump:


Users browsing this thread: 6 Guest(s)