When I Press C4 button then bomb doesn't explode.Help ASAP
#1

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]++;
						}
					}
                }
			}
		}
	}
Reply
#2

Anyone don't know how to fix this ?
Reply
#3

Debug. Add print statements before every if-statement, with the current value of the variable and the value that you would have expected it to be.
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
Debug. Add print statements before every if-statement, with the current value of the variable and the value that you would have expected it to be.
Sir I am not really getting your point what all u are saying to do I am little bit confused with the concept u are saying , can you please edit my code according to you.
Thank You it will be great full for me
Reply
#5

?? anyone ??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)