OnPlayerWeaponShot problem.
#1

As the title says.

I created a C4 script, and it can be detonated in 2 ways.

1) /detonatec4
2) Shooting at the box

But if i shoot at the box, and something goes wrong, it bugs the player ( Basically, no commands work etc. )

Code which i have at OnPlayerWeaponShot*
pawn Код:
//My code here ( if( hittype == BULLET_HIT_TYPE_OBJECT ) )
else if( hitid == 3052 || hitid == C4OBject )
    {
        foreach(Player, i)
        {
            if(IsPlayerInRangeOfPoint(i, 15, C4Pos[0], C4Pos[1], C4Pos[2]))
            {
                if(!SKProtection{ i })
                {
                    OnPlayerDeath(i, playerid, 39);
                    SpawnPlayer(i);
                GameTextForPlayer(i, "~r~You got C4'd!", 3500, 3);
                }
            }
            else if(IsPlayerInRangeOfPoint(i, 25, C4Pos[0], C4Pos[1], C4Pos[2]))
            {
                if(!SKProtection{ i })
        {
                SetPlayerHealth(i, 36);
            SendClientMessage(i, COLOR_RED, "* You got damaged from the C4 blast!");
        }
            }
            if(PlayerUsedBomb{ i })
            {
                DestroyObject(C4Object[i]);
                PlayerUsedBomb{ i } = false;
                Delete3DTextLabel(C4[i]);
            }
        }
        CreateExplosion(C4Pos[0], C4Pos[1]+1, C4Pos[2], 2, 100);
    CreateExplosion(C4Pos[0], C4Pos[1]+1, C4Pos[2], 3, 100);
    CreateExplosion(C4Pos[0], C4Pos[1]+1, C4Pos[2], 4, 100);
    //Delete3DTextLabel(C4[playerid]);
}
Or is something wrong at the way i create the C4 stuff?
Reply


Messages In This Thread
OnPlayerWeaponShot problem. - by Kyance - 02.04.2014, 18:32
Re: OnPlayerWeaponShot problem. - by Bingo - 02.04.2014, 18:35
Re: OnPlayerWeaponShot problem. - by Kyance - 02.04.2014, 18:36
Re: OnPlayerWeaponShot problem. - by Bingo - 02.04.2014, 18:41
Re: OnPlayerWeaponShot problem. - by Kyance - 02.04.2014, 18:49
Re: OnPlayerWeaponShot problem. - by Pottus - 02.04.2014, 18:54
Re: OnPlayerWeaponShot problem. - by Kyance - 02.04.2014, 18:55
Re: OnPlayerWeaponShot problem. - by Pottus - 02.04.2014, 19:02
Re: OnPlayerWeaponShot problem. - by Kyance - 03.04.2014, 04:17

Forum Jump:


Users browsing this thread: 2 Guest(s)