keystatechange
#1

I've tried all sorts to get this to work.
All i need it to do is explode a vehicle that the player puts a bomb in, the vehicle id is stored in BombVehicle.
I need to do this only if they're holding a detonator weapon as well, i'm just wondering if the check for the weapon i did was right or not.
When i put the exact same code into a command it works fine, but it only shows the message at the end that says "this works".
pawn Код:
if (PRESSED( KEY_FIRE ))
    {
        if(GetPlayerWeapon(playerid) == 40)
        {
            if(BombVehicle[playerid] == -1) return SendClientMessage(playerid, red, "Error: You don't have a bomb planted!");
            new Float:x, Float:y, Float:z;
            GetVehiclePos(BombVehicle[playerid], x, y, z);
            CreateExplosion(x, y, z, 6, 40.0);
            SetVehicleToRespawn(BombVehicle[playerid]);
            BombVehicle[playerid] = -1;
            SendFMessage(playerid, orange, "Car bomb detonated. You now have %d bombs left.", GetPVarInt(playerid, "bombs"));
        }
        SendClientMessage(playerid, red, "this works");
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)