25.07.2015, 22:12
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(playerid, YOURCOLOR, "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(playerid, YOURCOLOR, "Don't have a bomb attached in this vehicle."); //Verification if this car don't have a attached bomb.
new Float:vehx, Float:vehy, Float:vehz; //Create 3 float variables to store the coordinates of the car.
GetVehiclePos(currentveh, vehx, vehy, vehz); //Catch the coordinates of the car.
CreateExplosion(vehx, vehy, vehz, 0, 12.0); //Create a large explosion. (Similar to a Car explosion)
return 1
}
CMD:bombinfo(playerid) {
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, YOURCOLOR, "You don't are in a vehicle.");
if(HaveBomb == true) return SendClientMessage(playerid, YOURCOLOR, "Have a bomb attached in this vehicle! Rest in peace.");
if(HaveBomb == false) return SendClientMessage(playerid, YOURCOLOR, "Don't have a bomb attached in this vehicle! ");
return 1
}