07.01.2014, 04:31
Hey Guys , there is a problem in hitman faction that when I plant bomb and when I press the c4 button then nothing happens !! help please
Код:
if(PRESSED(KEY_FIRE))
{
if(BombID[playerid] != -1)
{
if(HoldingDetonator[playerid])
{
new Float:nx,Float:ny,Float:nz;
if(BombInCar[playerid] == 1)
{
GetVehiclePos(BombID[playerid], nz, ny, nz);
SetVehicleHealth(BombID[playerid], 0);
}
else
{
ClearAnimations(playerid);
ApplyAnimation(playerid,"PED","bomber",4.0,0,0,0,0,0);
GetDynamicObjectPos(BombID[playerid],nx,ny,nz);
DestroyDynamicObject(BombID[playerid]);
}
CreateExplosion(nx,ny,nz,7,10.0);
GameTextForPlayer(playerid, "~w~DETONATED", 3000, 3);
BombID[playerid] = -1;
TakeWeapon(playerid,40);
SetPlayerWeapons(playerid);
new killerid = GoChase[playerid];
if(IsPlayerInRangeOfPoint(killerid,3,nx,ny,nz))
{
if(GoChase[playerid] == killerid)
{
if(PlayerInfo[killerid][pHeadValue] > 0)
{
new string[128];
new price = PlayerInfo[killerid][pHeadValue];
new name[MAX_PLAYER_NAME];
new killa[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(killerid, killa, sizeof(killa));
PlayerInfo[killerid][pCash] = PlayerInfo[killerid][pCash]-price/2;
GivePlayerMoney(killerid, -price/2);
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+price/2;
GivePlayerMoney(playerid, price/2);
new witness;
GetPlayerPos(playerid, nx, ny, nz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 10.0, nx, ny, nz))
{
if(i != playerid && i != killerid) witness ++;
}
}
format(string,128,"Hitman %s has successfully assassinated %s with a C4 and collected $%d, %d withesses.",name,killa,price/2,witness);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsAHitman(i))
{
SendClientMessage(i, YELLOW, string);
}
}
format(string,128,"You have been critically injured by a hitman and lost $%d.",price/2);
SendClientMessage(killerid, YELLOW, string);
SetPlayerHealth(killerid, 0);
ClearContract(killerid);
GoChase[playerid] = 999;
PlayerInfo[playerid][pCHits]++;
}
}
}
}
}
}


