Attach bomb in car - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Attach bomb in car (
/showthread.php?tid=583097)
Attach bomb in car -
sscarface - 25.07.2015
- How can i attach a bomb in car?
- Also, It should show me car passenger the car i attached a bomb by using /bombinfo?
Hope, you guyz will help me. Thank you!
Re: Attach bomb in car -
iMFear - 25.07.2015
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
}
Re: Attach bomb in car -
sscarface - 25.07.2015
Thanks but I didn't check codes yet Cuz I'm on mobile. But I want bombinfo like I attached a bomb in a car and then I got out and then someone else with 2 friends get in my bomb car so when I type /bombinfo so it should show me these players are under bomb . Did u get me bro?
Re: Attach bomb in car -
TwinkiDaBoss - 25.07.2015
Here you go, this is my FS that should fit your desires
https://sampforum.blast.hk/showthread.php?tid=568160