Attach bomb in car
#2

This is a basic system, you can upgrade this for your use.

PHP код:
new bool:HaveBomb//Create a BOOL Variable to store the valor: "Have a bomb and don't have a bomb"
//I'm using ZCMD because is fast, but you can use anyone command processor.
CMD:attachbomb(playerid) {
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridYOURCOLOR"You don't are in a vehicle."); //Verification if the player is not in a vehicle.
    
HaveBomb true//Variable is setted to true. Like: "this car have a bomb."
    
SendClientMessage(playerid,  YOURCOLOR"Bomb attached!");
    return 
1;
}
CMD:detonatebomb(playerid) {
    if(
HaveBomb == false) return SendClientMessage(playeridYOURCOLOR"Don't have a bomb attached in this vehicle."); //Verification if this car don't have a attached bomb.
    
new Float:vehxFloat:vehyFloat:vehz//Create 3 float variables to store the coordinates of the car.
    
GetVehiclePos(currentvehvehxvehyvehz); //Catch the coordinates of the car.
    
CreateExplosion(vehxvehyvehz012.0); //Create a large explosion. (Similar to a Car explosion)
    
return 1
}
CMD:bombinfo(playerid) {
   if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridYOURCOLOR"You don't are in a vehicle.");
   if(
HaveBomb == true) return SendClientMessage(playeridYOURCOLOR"Have a bomb attached in this vehicle! Rest in peace.");
   if(
HaveBomb == false) return SendClientMessage(playeridYOURCOLOR"Don't have a bomb attached in this vehicle! ");
   return 
1

Reply


Messages In This Thread
Attach bomb in car - by sscarface - 25.07.2015, 22:07
Re: Attach bomb in car - by iMFear - 25.07.2015, 22:12
Re: Attach bomb in car - by sscarface - 25.07.2015, 23:15
Re: Attach bomb in car - by TwinkiDaBoss - 25.07.2015, 23:41

Forum Jump:


Users browsing this thread: 1 Guest(s)