02.04.2014, 18:32
(
Последний раз редактировалось Kyance; 02.04.2014 в 18:34.
Причина: fixed typos ;p
)
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*
Or is something wrong at the way i create the C4 stuff?
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]);
}