[Help] Code not working properly
#1

I got this code

pawn Код:
if(HOLDING(KEY_CROUCH))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(GetPlayerFaction(playerid) == 1)
            {
                new veh = GetPlayerVehicleID(playerid);
                if(VehicleInfo[veh][vFaction] == 1 && GetVehicleModel(veh) == 467)
                {
                    if(VehicleInfo[veh][vObjSet] == 1)
                    {
                        DestroyObject(VehicleInfo[veh][vObj]);
                        VehicleInfo[veh][vObjSet] = 0;
                    }
                    else
                    {
                        VehicleInfo[veh][vObjSet] = 1;
                        VehicleInfo[veh][vObj] = CreateObject(18646, 0, 0, 0, 0, 0, 0);
                        AttachObjectToVehicle(VehicleInfo[veh][vObj], veh, 0, 0, 0.90, 0, 0, 0);
                    }
                }
               
            }
        }
    }
When I'm holding the button, it works fine at the first time, the object is being attached and vObjSet is 1!.
When I'm holding the button again it creates the object and attaches it again.
It counts vObjSet as 0.

What's wrong with the code? I can't see anything wrong here.
Reply


Messages In This Thread
[Help] Code not working properly - by Maxips2 - 26.03.2011, 21:26
Re: [Help] Code not working properly - by Maxips2 - 29.03.2011, 18:52
Re: [Help] Code not working properly - by -Rebel Son- - 29.03.2011, 18:55
Re: [Help] Code not working properly - by Maxips2 - 29.03.2011, 18:56
Re: [Help] Code not working properly - by -Rebel Son- - 29.03.2011, 18:58
Re: [Help] Code not working properly - by Maxips2 - 29.03.2011, 19:12

Forum Jump:


Users browsing this thread: 2 Guest(s)