25.04.2013, 20:16
Hey guys, i need help on my PlantCarBomb for Hitmans, When you /plantcarbomb it then the car will start, the bomb will not explode. Here's my code.
Код:
CMD:pcb(playerid, params[]) { if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4) { if(PlayerInfo[playerid][pC4] == 0) { if(PlayerInfo[playerid][pBombs] != 0) { new carid = GetPlayerVehicleID(playerid); new closestcar = GetClosestCar(playerid, carid); if(IsPlayerInRangeOfVehicle(playerid, closestcar, 4.0)) { if(VehicleBomb{closestcar} == 1) { SendClientMessage(playerid, COLOR_GRAD2, "There is already a C4 on the vehicle engine!"); return 1; } VehicleBomb{closestcar} = 1; PlacedVehicleBomb[playerid] = closestcar; ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0); ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0); SendClientMessage(playerid, COLOR_GREEN, "You have placed C4 on the vehicle engine, /pickupbomb to remove it."); PlayerInfo[playerid][pC4] = 1; PlayerInfo[playerid][pBombs]--; PlayerInfo[playerid][pC4Used] = 2; } else { SendClientMessage(playerid, COLOR_GRAD2, "You're not close enough to any vehicle!"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, "You do not have C4!"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, " You can only deploy 1 C4 at a time ! "); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, "You're not a member of the Hitman Agency ! "); } return 1; }