After planting my bomb im trying to explode it,but it's not working.
Код:
if(IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
{
if(PlayerInfo[playerid][pC4Used] == 1)
{
if(GoChase[playerid] < 999)
{
if(IsPlayerInRangeOfPoint(GoChase[playerid], 12.0, GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z")))
{
if(PlayerInfo[GoChase[playerid]][pHeadValue] >= 1)
{
if(PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pLeader] == 4)
{
new
string[128],
name2[MAX_PLAYER_NAME],
name[MAX_PLAYER_NAME];
new takemoney = PlayerInfo[GoChase[playerid]][pHeadValue] / 4 * 2;
name = GetPlayerNameEx(GoChase[playerid]);
GivePlayerCash(playerid, takemoney);
GivePlayerCash(GoChase[playerid], -takemoney);
format(string,sizeof(string),"Hitman %s has fulfilled the contract on %s and collected $%d",GetPlayerNameEx(playerid),GetPlayerNameEx(GoChase[playerid]),PlayerInfo[GoChase[playerid]][pHeadValue] / 4 * 2);
SendFamilyMessage(4, COLOR_YELLOW, string);
format(string,sizeof(string),"You have been critically injured by a Hitman and lost $%d!",takemoney);
ResetPlayerWeaponsEx(GoChase[playerid]);
// SpawnPlayer(GoChase[playerid]);
SendClientMessage(GoChase[playerid], COLOR_YELLOW, string);
foreach(Player, i) {
name2 = GetPlayerNameEx(i);
if(!strcmp(PlayerInfo[GoChase[playerid]][pContractBy], name2, true)) {
if(!IsPlayerStreamedIn(i, GoChase[playerid])) {
format(string, sizeof(string), "SMS: The deed (on %s) has been done, Sender: MOLE (555)", name);
SendClientMessage(i, COLOR_YELLOW, string);
}
}
}
PlayerInfo[GoChase[playerid]][pHeadValue] = 0;
strcpy(PlayerInfo[GoChase[playerid]][pContractBy], "Nobody", 64);
strcpy(PlayerInfo[GoChase[playerid]][pContractDetail], "None", 64);
PlayerInfo[playerid][pCHits] += 1;
SetPlayerHealth(GoChase[playerid], 0.0);
// KillEMSQueue(GoChase[playerid]);
GotHit[GoChase[playerid]] = 0;
GetChased[GoChase[playerid]] = 999;
GoChase[playerid] = 999;
}
}
}
}
PlayerInfo[playerid][pC4Used] = 0;
CreateExplosion(GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z"), 7, 8);
PickUpC4(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "Bomb has been detonated!");
PlayerInfo[playerid][pC4Used] = 0;
return 1;
}