Author Topic: [ Advanced Plantbomb+ BuyBomb+ BuyCracker+ Defuse ] [ Full & FInal By me ]  (Read 2688 times)

0 Members and 1 Guest are viewing this topic.

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Hey !

I Created A Most Advance Bomb System!

Credits Me


Add This

Code: [Select]
new Bomb[MAX_PLAYERS];
new Bombed[MAX_PLAYERS];
new Cracker[MAX_PLAYERS];
new Defused[MAX_VEHICLES];

onplayerentervehicle
Code: [Select]
if(Bombed[vehicleid] == 1) {
PutDirectlyInVehicle(playerid,vehicleid);
SendClientMessage(playerid,COLOR_RED," The Vehicle You have Entered Has Been Bombed ");
GameTextForPlayer(playerid," Bomb Planted ");
SetVehicleHealth(vehicleid, 100);
Bombed[vehicleid] = 0;
}

OnPlayerCommandText

Code: [Select]
else if(strcmp(cmd,"buybomb", true) == 0) {
new tmp[123];
tmp = strtok(cmdtext,idx);
if(Bomb[playerid] == 1) SendClientMessage(playerid,COLOR_RED," Already Have A Bomb ");
else {
if(!strlen(tmp)) {
Bomb[playerid] = 1;
SendClientMessage(playerid,COLOR_GREEN," You Have Bought The Bomb ### ");
}
}
return 1;
}

else if(strcmp(cmd,"plantbomb", true) == 0) {
new tmp[123];
tmp = strtok(cmdtext,idx);
if(Bomb[playerid] == 0) SendClientMessage(playerid,COLOR_RED,"Dont Have A Bomb");
else if(Bombed[GetPlayerVehicleID(playerid)] == 1) SendClientMessage(playerid,COLOR_RED," Bomb Already Planted ");
else if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,COLOR_GREEN," Not In Vehicle ");
else {
Bomb[playerid] = 0;
Defused[GetPlayerVehicleID(playerid)] = 1;
SetTimer("BombTime", 100000, 0);
Bombed[GetPlayerVehicleID(playerid)] = 1;
SendClientMessage(playerid,COLOR_RED," Bomb Has Been Planted ");
}
return 1;
}

else if(strcmp(cmd,"buycracker", true) == 0) {
if(Cracker[playerid] == 1) SendClientMessage(playerid,COLOR_RED," You Already Have Cracker ");
else {
Cracker[playerid] = 1;
SendClientMessage(playerid,COLOR_RED," Cracker Has Been Bought Do /c defuse ");
}
return 1;
}

else if(strcmp(cmd,"defuse", true) == 0) {
if(Cracker[playerid] == 0) SendClientMessage(playerid,COLOR_GREEN," Not Have Cracker ");
else if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,COLOR_RED," Not In vehicle ");
else {
if(Defused[GetPlayerVehicleID(playerid)] == 1) {
Cracker[playerid] = 0;
Bombed[GetPlayerVehicleID(playerid)] == 0;
RemovePlayerFromVehicle(playerid);
SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
GameTextForPlayer(playerid," Bomb Defused ");
}

if(Defused[GetPlayerVehicleID(playerid)] == 0) {
Bombed[GetPlayerVehicleID(playerid)] == 1;
GameTextForPlayer(playerid," Bomb Defusing Failed ");
}
}
return 1;
}
 


Timer & Stock
Code: [Select]
forward BombTime();
public BombTime() {
for(new i ; i <MAX_VEHICLES;i++) {
if(Bombed[i] == 1) {
if(Defused[i] == 1) {
Defused[i] = 0;
}
}
}
return 1;
}

Features Of It!

Bomb Can Be Defusable
Bomb Can't Be Defused After 100 Seconds Of Planting BOmb
Bomb Can Be Bought
Bomb Can Be Planted
Need A Cracker To Crack The Bomb

« Last Edit: March 19, 2014, 11:27:42 am by mrockxkingbutt »
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol