Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- _____________ _____________
- ||___________ | ____________|
- || || ||
- || || ||
- ||___________ || ||
- ||___________ || ||
- || || ||
- || || ||
- ||___________ ||___________||
- ||___________ ||____________|
- EO_Explosives Shop
- **CopyRight Claim: Please do not upload this or edit it without my permission, as it still on the developement stage,
- =====================================================================================================================================================================
- =====================================================================================================================================================================
- ====================================================================================================================================================================*/
- #define FILTERSCRIPT
- #include <a_samp>
- #include <sscanf2>
- #include <ZCMD>
- #include <YSI\y_ini>
- //Colors
- #define Blren 0x058E6AFF
- #define Red 0xFF0000FF
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" EO_Explosives Shop v0.8 ");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" EO_Explosives Shop by E.Oussama ");
- print("----------------------------------\n");
- }
- #endif
- new Float:gC[3];
- new pBomb[MAX_PLAYERS];
- new pQBHydraucs[MAX_PLAYERS];
- new pQBCore[MAX_PLAYERS];
- new pBombTimer[MAX_PLAYERS];
- new pABICheck[MAX_PLAYERS];
- new pSBCheck[MAX_PLAYERS];
- new Float:pBombPos[MAX_PLAYERS][3];
- new Float:pABombPos[MAX_PLAYERS][3];
- new Float:pQBombPos[MAX_PLAYERS][3];
- new pSVBTimer[MAX_PLAYERS];
- new pQBombATimer[MAX_PLAYERS];
- new Float:pMPos[MAX_PLAYERS][3];
- new pMObject[MAX_PLAYERS];
- new pAMCheck[MAX_PLAYERS];
- //DIALOGS
- enum{
- DIALOG_EVMINDEX,
- DIALOG_EVMPSTATS,
- DIALOG_EHELP,
- DIALOG_TBomb
- };
- enum E_PLAYER_BOMB_DATA{
- bool:BombUse,
- bool:BombEx,
- bool:BombC4,
- bool:AtBomb,
- bool:CarBomb,
- bool:MBombEx,
- bool:AMBomb,
- bool:pSBomb,
- Bomb,
- SuBomb,
- QBomb,
- EBBomb,
- TBomb,
- MBomb,
- CBomb,
- ABomb,
- SBomb,
- C4
- };
- new pbData[MAX_PLAYERS][E_PLAYER_BOMB_DATA];
- new vbData[MAX_VEHICLES][E_PLAYER_BOMB_DATA];
- //TIMERS
- forward BombTimer(playerid);
- forward TimingBombTimer(playerid);
- forward VehicleCarBombClear(vehicleid);
- forward CarBombActivation(vehicleid);
- forward atomicbombimpact(playerid);
- forward SuVBTimer(playerid);
- forward QuantumBombActivation(playerid);
- /*=====================================================================================================================================================================
- =====================================================================================================================================================================
- ======================================================|| Configuration Panel ||=======================================================================================*/
- //Bombs Prices
- #define BombP 2500 // Normal bomb
- #define TBombP 5000 //Settable timed bomb
- #define C4P 10000 //C4 remote-controlled
- #define CBombP 12000 //Vehicle bomb
- #define ABombP 20000 //Atomic Bomb
- #define SBombP 9000 //Stiky bomb
- #define SuBombP 6000 //Suicidal bomb
- #define QBombP 30000 //quantum bomb
- #define MBombP 15000 //Mines
- #define EBarrelP 3500 //Explosive barrel
- #define FireworksP 6000 //Fireworks
- //Timers
- #define BrakingTimer 300000 //Timer between using each bomb
- #define VehicleBombClearTimer 300000 //Time to clear all vehicle car bombs
- /*=====================================================================================================================================================================
- ====================================================================================================================================================================*/
- public OnGameModeInit()
- {
- SetGameModeText("EO_Explosives Shop v0.8");
- AddPlayerClass(0, 1173.1952,-1324.2224,15.3951, 269.1425, 0, 0, 0, 0, 0, 0);
- SetTimer("VehicleCarBombClear",VehicleBombClearTimer,true);
- return 1;
- }
- public OnGameModeExit()
- {
- SetGameModeText("EO_Explosives Shop v0.8");
- AddPlayerClass(0, 1173.1952,-1324.2224,15.3951, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- pbData[playerid][BombEx] = false;
- pbData[playerid][BombC4] = false;
- pbData[playerid][AtBomb] = false;
- pbData[playerid][MBombEx] = false;
- pbData[playerid][pSBomb] = false;
- pbData[playerid][AMBomb] = false;
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- pbData[playerid][Bomb] = 0;
- pbData[playerid][BombEx] = false;
- pbData[playerid][AtBomb] = false;
- pbData[playerid][BombUse] = true;
- pbData[playerid][BombC4] = false;
- pbData[playerid][pSBomb] = false;
- pbData[playerid][MBombEx] = false;
- pbData[playerid][AMBomb] = false;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- pbData[playerid][BombEx] = false;
- pbData[playerid][BombC4] = false;
- pbData[playerid][pSBomb] = false;
- pbData[playerid][AtBomb] = false;
- pbData[playerid][AMBomb] = false;
- pbData[playerid][MBombEx] = false;
- pbData[playerid][Bomb] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- pbData[playerid][BombEx] = false;
- pbData[playerid][BombC4] = false;
- pbData[playerid][AtBomb] = false;
- pbData[playerid][pSBomb] = false;
- pbData[playerid][MBombEx] = false;
- TogglePlayerControllable(playerid, true);
- pbData[playerid][Bomb] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(pbData[playerid][BombEx] == true){
- SendClientMessage(playerid, Red, "[EO_INFO]: {FFFFFF}The Bomb you planted has been deactivated");
- }
- pbData[playerid][BombEx] = false;
- pbData[playerid][BombC4] = false;
- pbData[playerid][AtBomb] = false;
- pbData[playerid][pSBomb] = false;
- pbData[playerid][AMBomb] = false;
- pbData[playerid][MBombEx] = false;
- pbData[playerid][Bomb] = 0;
- DestroyObject(pBomb[playerid]);
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- CMD:makeevm(playerid, params[]){
- new Float:x, Float:y, Float:z, Float:r;
- GetPlayerFacingAngle(playerid, r);
- GetPlayerPos(playerid, x, y, z);
- if(IsPlayerAdmin(playerid)){
- if(!IsPlayerInAnyVehicle(playerid)){
- CreateObject(18885, x+1, y, z, 0.0, 0.0, -r);
- SendClientMessage(playerid, 0xFFFF00, "[EO_EVM]: {FFFFFF}Explosives Vending Machine successfully created!");
- return 1;
- }
- else{
- SendClientMessage(playerid, 0xFF0000, "[ERROR]: You can't use this while in a vehicle");
- }
- }
- else{
- SendClientMessage(playerid, 0xFF0000AA, "[ERROR]: You can't use this command");
- }
- return 1;
- }
- //explosives stats
- CMD:estats(playerid, params[]){
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- new pname[MAX_PLAYER_NAME], str[250];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(str, sizeof(str), "{CCCCFF}%s{FFFFFF}\n\nBombs: %i\t\tTiming Bombs: %i\nC4: %i\t\t\tCar Bombs: %i\nAtomic Bombs: %i\tSticky Bombs: %i\nBomb Vests: %i\t\tQuantum Bombs: %i\nMines: %i\t\tExplosive Barrels: %i",pname, pbData[playerid][Bomb],pbData[playerid][TBomb],pbData[playerid][C4],pbData[playerid][CBomb],pbData[playerid][ABomb],pbData[playerid][SBomb],pbData[playerid][SuBomb],pbData[playerid][QBomb],pbData[playerid][MBomb],pbData[playerid][EBBomb]);
- ShowPlayerDialog(playerid, DIALOG_EVMPSTATS, DIALOG_STYLE_MSGBOX, "EO_Explosive Stats", str, "Got it!", "");
- return 1;
- }
- //Explosives help index
- CMD:ehelp(playerid, params[]){
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- new str[2500];
- strcat(str,"{FFFF00}Bomb: {FFFFFF}A 3 seconds timed bomb with a normal exploding radius, it can be used via /plantbomb\n");
- strcat(str,"{FFFF00}Timing Bomb: {FFFFFF} It's a bomb whose detonation is triggered by a timer which has to be closed in 3 to 60 seconds,\n it can be used via /planttbomb\n");
- strcat(str,"{FFFF00}C4: {FFFFFF}A Remote-controlled bomb, which can be setup somewhere using /plantc4 then detonated via /detonate\n");
- strcat(str,"{FFFF00}Car Bomb: {FFFFFF}A Vehicle related bomb, in order to use it, you be inside of a vehicle, then use /plantvehbomb , after that, you will have to leave the vehicle immediately,\n the bomb will be activated within 3 seconds, and anybody who enters the vehicle by then, will be exploded\n");
- strcat(str,"{FFFF00}Atomic Bomb: {FFFFFF} A bomb that derives its destructive power from the rapid release of nuclear energy, in ordet to use it you have to choose a position, then use /setabpos \nand to activate it, you have to be in a Pony or a Burrito and use /launchab\n");
- strcat(str,"{FFFF00}Sticky Bomb: {FFFFFF} A Sticky Bomb is an explosive charge that when thrown against a player using /attachsbomb sticks until it explodes.\n");
- strcat(str,"{FFFF00}Suicidal bomb vest: {FFFFFF} A Suicidal bomb vest is an armour-like shaped, but instead of protecting you, it activates explosives that will take you and anyone close to you down, to activate it, simply use /mountsvb\n");
- strcat(str,"{FFFF00}Quantum Bomb: {FFFFFF} A Quantum Bomb differs from other bombs with its ability to pull nearby players then teleports them high in the air, next explode them, you can use it via /setqbomb\n");
- strcat(str,"{FFFF00}Mines: {FFFFFF} A mine is an explosive placed underground or underwater that explodes when disturbed, you can use it via /plantmine, then to activate it, use /activatemine\n");
- strcat(str,"{FFFF00}Explosive Barrels: {FFFFFF} An Explosive-loaded steel barrels, that explode upon a physical contact, whether shot or hit, you can place them anywhere using /placeeb\n");
- ShowPlayerDialog(playerid, DIALOG_EHELP, DIALOG_STYLE_MSGBOX, "EO_Explosives Help Section", str, "Got it","");
- return 1;
- }
- CMD:evmshop(playerid, params[]){
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- ShowPlayerDialog(playerid, DIALOG_EVMINDEX, DIALOG_STYLE_LIST, "EO_Explosive Shop",
- "Bomb\n\
- Timing bomb\n\
- C4\n\
- Car bomb\n\
- Atomic bomb\n\
- Sticky bombs\n\
- Suicidal bomb vest\n\
- Quantum bomb\n\
- Mines\n\
- Explosive barrels"
- ,"Select", "Cancel");
- return 1;
- }
- ////////////////////////// BOMBS ////////////////////////////////////////
- //Bomb
- CMD:plantbomb(playerid, params[]){
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(pbData[playerid][Bomb] == 0) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You don't have a bomb");
- if(pbData[playerid][BombUse] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: Wait before using another bomb");
- GetPlayerPos(playerid, gC[0], gC[1], gC[2]);
- pBomb[playerid] = CreateObject(1252, gC[0], gC[1], gC[2], 0.0, 0.0,0.0);
- pBombPos[playerid][0] = gC[0];
- pBombPos[playerid][1] = gC[1];
- pBombPos[playerid][2] = gC[2];
- pBombTimer[playerid] = SetTimerEx("BombTimer", 3000, false, "i", playerid);
- pbData[playerid][BombUse] = false;
- pbData[playerid][Bomb]--;
- pbData[playerid][BombEx] = true;
- return 1;
- }
- //Timming Bomb
- CMD:planttbomb(playerid, params[]){
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(pbData[playerid][TBomb] == 0) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You don't have a timing bomb");
- if(pbData[playerid][BombUse] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: Wait before using another bomb");
- ShowPlayerDialog(playerid, DIALOG_TBomb, DIALOG_STYLE_INPUT, "Timing Bomb","Setup the seconds of the bomb to explode", "Setup", "Cancel");
- return 1;
- }
- //C4
- CMD:plantc4(playerid, params[]){
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(pbData[playerid][C4] == 0) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You don't have a C4");
- if(pbData[playerid][BombUse] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: Wait before using another bomb");
- GetPlayerPos(playerid, gC[0], gC[1], gC[2]);
- pBomb[playerid] = CreateObject(1252, gC[0], gC[1], gC[2]-1, 0.0, 0.0,0.0);
- pBombPos[playerid][0] = gC[0];
- pBombPos[playerid][1] = gC[1];
- pBombPos[playerid][2] = gC[2];
- pbData[playerid][BombUse] = false;
- pbData[playerid][C4]--;
- SendClientMessage(playerid, Blren, "[EO_INFO]: {FFFFFF}You can use {FFFF00}/detonate {FFFFFF}to activate the C4");
- pbData[playerid][BombEx] = true;
- pbData[playerid][BombC4] = true;
- return 1;
- }
- CMD:detonate(playerid, params[]){
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(pbData[playerid][BombC4] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: There is no C4 to blowup");
- SendClientMessage(playerid, Blren, "[EO_INFO]: {FFFFFF}You have detonated the C4");
- CreateExplosion(pBombPos[playerid][0],pBombPos[playerid][1], pBombPos[playerid][2], 1, 5);
- pbData[playerid][BombUse] = false;
- SetTimerEx("BombBrakeTimer", BrakingTimer, false, "i", playerid);
- DestroyObject(pBomb[playerid]);
- pbData[playerid][BombC4] = false;
- pbData[playerid][BombEx] = false;
- return 1;
- }
- //Car bomb
- CMD:plantvehbomb(playerid, params[]){
- new vehicleid = GetPlayerVehicleID(playerid);
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You have to be in a vehicle to use this!");
- if(pbData[playerid][CBomb] == 0) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You don't have a Car bomb");
- if(pbData[playerid][BombUse] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: Wait before using another bomb");
- vbData[vehicleid][CarBomb] = true;
- SendClientMessage(playerid, Blren, "[EO_INFO]: You have planted a car bomb in this vehicle");
- SendClientMessage(playerid, Blren, "[EO_INFO]: The car bomb will be activated if anyone attempts to drive it");
- pbData[playerid][BombEx] = true;
- pbData[playerid][BombUse] = false;
- return 1;
- }
- //Atomic bomb
- CMD:setabpos(playerid, params[]){
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(pbData[playerid][ABomb] == 0) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You don't have an Atomic bomb");
- if(pbData[playerid][BombUse] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: Wait before using another bomb");
- GetPlayerPos(playerid, gC[0], gC[1], gC[2]);
- pABombPos[playerid][0] = gC[0];
- pABombPos[playerid][1] = gC[1];
- pABombPos[playerid][2] = gC[2]+100;
- pbData[playerid][BombUse] = false;
- pbData[playerid][ABomb]--;
- pbData[playerid][BombEx] = true;
- pbData[playerid][AtBomb] = true;
- SendClientMessage(playerid, Blren, "[EO_INFO]: {FFFFFF}The atomic bomb impact position has been set!");
- return 1;
- }
- CMD:launchab(playerid,params[]){
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(pbData[playerid][AtBomb] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: There is no posetion set to activate the atomic bomb");
- if(IsPlayerInAnyVehicle(playerid)){
- if(GetVehicleModel(GetPlayerVehicleID(playerid) == 413 || GetPlayerVehicleID(playerid) == 482)){
- pBomb[playerid] = CreateObject(3786, pABombPos[playerid][0], pABombPos[playerid][1], pABombPos[playerid][2], 0.0,-90,0.0);
- MoveObject(pBomb[playerid],pABombPos[playerid][0], pABombPos[playerid][1], pABombPos[playerid][2]-100,30,0.0,-90,0.0);
- SendClientMessage(playerid, Blren, "[EO_INFO]: {FFFFFF}The atomic bomb has been launched");
- pABICheck[playerid] = SetTimer("atomicbombimpact", 100, true);
- }
- else{
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: You have to be in a Pony or a Burrito to launch the Atomic Bomb");
- }
- }
- else{
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: You have to be in a Pony or a Burrito to launch the Atomic Bomb");
- }
- return 1;
- }
- public atomicbombimpact(playerid){
- new Float:ax,Float:ay,Float:az;
- GetObjectPos(pBomb[playerid],ax, ay, az);
- if(ax == pABombPos[playerid][0] && ay == pABombPos[playerid][1] && az == pABombPos[playerid][2]-100){
- CreateExplosion(pABombPos[playerid][0]+10,pABombPos[playerid][1]+5, pABombPos[playerid][2]-100, 2, 20);
- CreateExplosion(pABombPos[playerid][0]+3,pABombPos[playerid][1]+2, pABombPos[playerid][2]-100, 3, 20);
- CreateExplosion(pABombPos[playerid][0]-10,pABombPos[playerid][1], pABombPos[playerid][2]-100, 4, 20);
- CreateExplosion(pABombPos[playerid][0],pABombPos[playerid][1]+8, pABombPos[playerid][2]-100, 1, 20);
- CreateExplosion(pABombPos[playerid][0],pABombPos[playerid][1], pABombPos[playerid][2]-100, 2, 20);
- CreateExplosion(pABombPos[playerid][0]+12,pABombPos[playerid][1]+4, pABombPos[playerid][2]-100, 2, 20);
- CreateExplosion(pABombPos[playerid][0]+10,pABombPos[playerid][1]-6, pABombPos[playerid][2]-100, 2, 20);
- CreateExplosion(pABombPos[playerid][0],pABombPos[playerid][1], pABombPos[playerid][2]-100, 13, 20);
- CreateExplosion(pABombPos[playerid][0],pABombPos[playerid][1]+2, pABombPos[playerid][2]-100, 6, 20);
- CreateExplosion(pABombPos[playerid][0]-10,pABombPos[playerid][1]-5, pABombPos[playerid][2]-100, 2, 100);
- CreateExplosion(pABombPos[playerid][0]-3,pABombPos[playerid][1]-2, pABombPos[playerid][2]-100, 3, 100);
- CreateExplosion(pABombPos[playerid][0]+10,pABombPos[playerid][1], pABombPos[playerid][2]-100, 4, 100);
- CreateExplosion(pABombPos[playerid][0],pABombPos[playerid][1]-8, pABombPos[playerid][2]-100, 1, 100);
- CreateExplosion(pABombPos[playerid][0]+20,pABombPos[playerid][1], pABombPos[playerid][2]-100, 2, 100);
- CreateExplosion(pABombPos[playerid][0]-12,pABombPos[playerid][1]-4, pABombPos[playerid][2]-100, 2, 100);
- CreateExplosion(pABombPos[playerid][0]-10,pABombPos[playerid][1]+6, pABombPos[playerid][2]-100, 2, 100);
- CreateExplosion(pABombPos[playerid][0],pABombPos[playerid][1]-2, pABombPos[playerid][2]-100, 7, 100);
- CreateExplosion(pABombPos[playerid][0]-15,pABombPos[playerid][1]-15, pABombPos[playerid][2]-100, 2, 20);
- CreateExplosion(pABombPos[playerid][0]-13,pABombPos[playerid][1]-20, pABombPos[playerid][2]-100, 3, 20);
- CreateExplosion(pABombPos[playerid][0]+15,pABombPos[playerid][1], pABombPos[playerid][2]-100, 4, 20);
- CreateExplosion(pABombPos[playerid][0],pABombPos[playerid][1]-18, pABombPos[playerid][2]-100, 1, 20);
- CreateExplosion(pABombPos[playerid][0]+18,pABombPos[playerid][1], pABombPos[playerid][2]-100, 2, 20);
- CreateExplosion(pABombPos[playerid][0]-22,pABombPos[playerid][1]-24, pABombPos[playerid][2]-100, 2, 20);
- CreateExplosion(pABombPos[playerid][0]-20,pABombPos[playerid][1]+16, pABombPos[playerid][2]-100, 2, 20);
- CreateExplosion(pABombPos[playerid][0]+30,pABombPos[playerid][1]+30, pABombPos[playerid][2]-100, 6, 100);
- CreateExplosion(pABombPos[playerid][0]-30,pABombPos[playerid][1]+30, pABombPos[playerid][2]-100, 6, 100);
- CreateExplosion(pABombPos[playerid][0]+30,pABombPos[playerid][1]+0, pABombPos[playerid][2]-100, 6, 100);
- CreateExplosion(pABombPos[playerid][0]-30,pABombPos[playerid][1]+10, pABombPos[playerid][2]-100, 6, 100);
- CreateExplosion(pABombPos[playerid][0]-30,pABombPos[playerid][1]-30, pABombPos[playerid][2]-100, 6, 100);
- CreateExplosion(pABombPos[playerid][0]+20,pABombPos[playerid][1]-30, pABombPos[playerid][2]-100, 6, 100);
- DestroyObject(pBomb[playerid]);
- for(new i=0;i<=MAX_PLAYERS;i++){
- if(!IsPlayerConnected(i)) continue;
- if(IsPlayerInRangeOfPoint(i,100,pABombPos[playerid][0],pABombPos[playerid][1], pABombPos[playerid][2]-100)){
- SetPlayerDrunkLevel (playerid, 5000);
- SetPlayerArmour(i,0);
- SetPlayerHealth(i,0);
- }
- }
- }
- pbData[playerid][BombUse] = false;
- pbData[playerid][BombEx] = false;
- pbData[playerid][AtBomb] = false;
- }
- //Sticky Bomb
- CMD:attachsbomb(playerid, params[]){
- new tid, str[40+MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME];
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(pbData[playerid][SBomb] == 0) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You don't have a Sticky bomb");
- if(pbData[playerid][BombUse] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: Wait before using another bomb");
- if(sscanf(params, "u", tid)) return SendClientMessage(playerid, 0xFFFFFF, "[USAGE]: /attachsbomb (playerid)");
- if(!IsPlayerConnected(tid) || tid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: This player is not connected");
- if(tid == playerid) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You can't stick a bomb to yourself");
- GetPlayerName(playerid, pname, sizeof(pname));
- GetPlayerName(tid, tname, sizeof(tname));
- pbData[tid][pSBomb] = true;
- pSBCheck[playerid] = SetTimer("stickybombexp", 3000, false);
- pbData[playerid][BombUse] = false;
- pbData[playerid][SBomb]--;
- pbData[playerid][BombEx] = true;
- format(str, sizeof(str), "[EO_INFO]: {FFFFFF}%s Has thrown a sticky bomb on you",pname);
- SendClientMessage(tid, Blren, str);
- format(str, sizeof(str), "[EO_INFO]: {FFFFFF}You have sticked a sticky bomb to %s",tname);
- SendClientMessage(playerid, Blren, str);
- return 1;
- }
- forward stickybombexp(playerid);
- public stickybombexp(playerid){
- new Float:sx, Float:sy, Float:sz;
- GetPlayerPos(playerid, sx, sy, sz);
- SetPlayerArmour(playerid,0);
- SetPlayerHealth(playerid, 0);
- CreateExplosion(sx, sy, sz, 2, 10);
- pbData[playerid][BombEx] = false;
- pbData[playerid][BombUse] = false;
- }
- //Suicidal vest
- CMD:mountsvb(playerid, params[]){
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(pbData[playerid][SuBomb] == 0) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You don't have a Suicidal bomb vest");
- if(pbData[playerid][BombUse] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: Wait before using another bomb");
- SetPlayerAttachedObject(playerid, 1, 19515, 1, 0, 0.0, 0.0, 0, 0, 0, 1, 1, 1, 0xFF00FF00);
- pSVBTimer[playerid] = SetTimer("SuVBTimer", 3000, false);
- pbData[playerid][SuBomb]--;
- pbData[playerid][BombEx] = true;
- pbData[playerid][BombUse] = false;
- return 1;
- }
- public SuVBTimer(playerid){
- new Float:svbx, Float:svby, Float:svbz;
- GetPlayerPos(playerid, svbx, svby, svbz);
- SetPlayerArmour(playerid, 0);
- SetPlayerHealth(playerid, 0);
- CreateExplosion(svbx,svby, svbz, 2, 20);
- RemovePlayerAttachedObject(playerid, 1);
- pbData[playerid][BombEx] = false;
- pbData[playerid][BombUse] = false;
- }
- //Quantum bomb
- CMD:setqbomb(playerid, params[]){
- new Float:pqx, Float:pqy, Float:pqz;
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(pbData[playerid][QBomb] == 0) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You don't have a Quantum bomb");
- if(pbData[playerid][BombUse] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: Wait before using another bomb");
- GetPlayerPos(playerid, pqx, pqy, pqz);
- pQBCore[playerid] = CreateObject(919 ,pqx, pqy, pqz-0.5, 0.0,0.0,0.0,100);
- pQBHydraucs[playerid] = CreateObject(930, pqx+0.8, pqy, pqz-0.5, 0.0,0.0,90.0,100);
- pQBombPos[playerid][0] = pqx;
- pQBombPos[playerid][1] = pqy;
- pQBombPos[playerid][2] = pqz;
- pQBombATimer[playerid] = SetTimer("QuantumBombActivation", 5000, false);
- pbData[playerid][QBomb]--;
- pbData[playerid][BombUse] = false;
- pbData[playerid][BombEx] = true;
- SendClientMessage(playerid, Blren, "[EO_INFO]: {FFFFFF}The Quantum bomb has been activated, the effect will start in 3 seconds");
- return 1;
- }
- public QuantumBombActivation(playerid){
- for(new i=0;i<=MAX_PLAYERS;i++){
- if(IsPlayerInRangeOfPoint(i,40, pQBombPos[playerid][0], pQBombPos[playerid][1], pQBombPos[playerid][2])){
- TogglePlayerControllable(i, false);
- SetPlayerPos(i, pQBombPos[playerid][0], pQBombPos[playerid][1], pQBombPos[playerid][2]);
- SetPlayerArmour(i, 0);
- SetPlayerHealth(i, 50);
- SendClientMessage(i, Blren, "[EO_INFO]: {FFFFFF}You have been pulled to the Quantum explosion core");
- }
- }
- CreateExplosion(pQBombPos[playerid][0],pQBombPos[playerid][1], pQBombPos[playerid][2], 2, 50);
- DestroyObject(pQBCore[playerid]);
- DestroyObject(pQBHydraucs[playerid]);
- pbData[playerid][BombUse] = false;
- pbData[playerid][BombEx] = false;
- for(new i=0;i<=MAX_PLAYERS;i++){
- if(IsPlayerInRangeOfPoint(i,40, pQBombPos[playerid][0], pQBombPos[playerid][1], pQBombPos[playerid][2])){
- TogglePlayerControllable(i, true);
- SetPlayerPos(i, pQBombPos[playerid][0]-70, pQBombPos[playerid][1]+60, pQBombPos[playerid][2]+350);
- CreateExplosion(pQBombPos[playerid][0]-70,pQBombPos[playerid][1]+60, pQBombPos[playerid][2]+350, 2, 50);
- }
- }
- }
- //Mines
- CMD:plantmine(playerid, params[]){
- new Float:pmx, Float:pmy, Float:pmz;
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(pbData[playerid][MBomb] == 0) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You don't have a Mine");
- if(pbData[playerid][BombUse] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: Wait before using another bomb");
- GetPlayerPos(playerid, pmx, pmy, pmz);
- pMPos[playerid][0] = pmx;
- pMPos[playerid][1] = pmy;
- pMPos[playerid][2] = pmz;
- pMObject[playerid] = CreateObject(2992,pMPos[playerid][0], pMPos[playerid][1], pMPos[playerid][2]-0.85, 0.0, 0.0, 0.0, 3);
- pAMCheck[playerid] = SetTimer("MineCheck", 50, true);
- pbData[playerid][MBomb]--;
- pbData[playerid][BombUse] = false;
- pbData[playerid][BombEx] = true;
- pbData[playerid][MBombEx] = true;
- pbData[playerid][AMBomb] = false;
- return 1;
- }
- CMD:activatemine(playerid,params[]){
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: You are not connected to the server");
- if(pbData[playerid][MBombEx] == false) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: There is no Mine to activate");
- if(pbData[playerid][AMBomb] == true) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: Your Mine bomb is already activated");
- pbData[playerid][AMBomb] = true;
- SendClientMessage(playerid, Blren, "[EO_INFO]: {FFFFFF}You have activated your Mine");
- return 1;
- }
- forward MineCheck(playerid);
- public MineCheck(playerid){
- if(pbData[playerid][BombEx] == true && pbData[playerid][MBombEx] == true)
- {
- if(pbData[playerid][AMBomb] == true)
- {
- for(new i=0; i<=MAX_PLAYERS; i++)
- {
- if(IsPlayerInRangeOfPoint(i,2,pMPos[playerid][0],pMPos[playerid][1],pMPos[playerid][2]))
- {
- if(!IsPlayerConnected(i)) continue;
- SetPlayerArmour(i, 0);
- SetPlayerArmour(i,10);
- CreateExplosion(pMPos[playerid][0],pMPos[playerid][1], pMPos[playerid][2], 2, 30);
- DestroyObject(pMObject[playerid]);
- pbData[playerid][BombUse] = false;
- pbData[playerid][BombEx] = false;
- pbData[playerid][MBombEx] = false;
- pbData[playerid][AMBomb] = false;
- }
- }
- }
- }
- }
- //Barrel
- CMD:placeeb(playerid, params[]){
- new Float:ebx, Float:eby, Float:ebz;
- GetPlayerPos(playerid, ebx, eby, ebz);
- CreateObject(1225, ebx+0.5, eby, ebz, 0.0, 0.0, 0.0);
- pbData[playerid][EBBomb]--;
- return 1;
- }
- //////////////////////////////// TIMERS //////////////////////////////////////
- //Time to explode
- public BombTimer(playerid){
- KillTimer(pBombTimer[playerid]);
- CreateExplosion(pBombPos[playerid][0],pBombPos[playerid][1], pBombPos[playerid][2], 1, 5);
- pbData[playerid][BombUse] = false;
- SetTimerEx("BombBrakeTimer", BrakingTimer, false, "i", playerid);
- DestroyObject(pBomb[playerid]);
- pbData[playerid][BombEx] = false;
- }
- //Timed bomb exploding timer
- public TimingBombTimer(playerid){
- if(pbData[playerid][BombEx] == true){
- KillTimer(pBombTimer[playerid]);
- CreateExplosion(pBombPos[playerid][0],pBombPos[playerid][1], pBombPos[playerid][2], 1, 5);
- pbData[playerid][BombEx] = false;
- DestroyObject(pBomb[playerid]);
- }
- }
- //Car bomb clearing
- public VehicleCarBombClear(vehicleid){
- new str[250],Count=0;
- for(new i=0; i<=MAX_VEHICLES;i++){
- if(vbData[i][CarBomb] == true) return Count++;
- vbData[i][CarBomb] = false;
- }
- format(str,sizeof(str), "[EO_INFO]: {FFFFFF}All vehicle bombs were cleared, {FFFF00}(total: %i)",Count);
- SendClientMessageToAll(Blren, str);
- return 1;
- }
- /////////////////////////// Brake Timer ///////////////////////////////////
- forward BombBrakeTimer(playerid);
- public BombBrakeTimer(playerid){
- pbData[playerid][BombUse] = true;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- new Float:x, Float:y, Float:z;
- if(vbData[vehicleid][CarBomb] == true){
- GetVehiclePos(vehicleid, x, y, z);
- SetVehicleHealth(vehicleid, 0);
- CreateExplosion(x,y, z, 2, 10);
- pbData[playerid][BombEx] = false;
- vbData[vehicleid][BombUse] = false;
- vbData[vehicleid][CarBomb] = false;
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_EVMINDEX){
- switch(listitem){
- case 0:{
- if(GetPlayerMoney(playerid) >= BombP){
- new string[120];
- pbData[playerid][Bomb]++;
- GivePlayerMoney(playerid, -TBombP);
- format(string, sizeof(string), "[EO_INFO]: {FFFFFF}You bought a Bomb for $%i, the use instructions via /ehelp",BombP);
- SendClientMessage(playerid, 0xFFFF0088, string);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You can't afford this");
- }
- case 1:{
- if(GetPlayerMoney(playerid) >= TBombP){
- new string[120];
- pbData[playerid][TBomb]++;
- GivePlayerMoney(playerid, -TBombP);
- format(string, sizeof(string), "[EO_INFO]: {FFFFFF}You bought a Timing Bomb for $%i, the use instructions via /ehelp",TBombP);
- SendClientMessage(playerid, 0xFFFF0088, string);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You can't afford this");
- }
- case 2:{
- if(GetPlayerMoney(playerid) >= C4P){
- new string[120];
- pbData[playerid][C4]++;
- GivePlayerMoney(playerid, -C4P);
- format(string, sizeof(string), "[EO_INFO]: {FFFFFF}You bought a C4 for $%i, the use instructions via /ehelp",C4P);
- SendClientMessage(playerid, 0xFFFF0088, string);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You can't afford this");
- }
- case 3:{
- if(GetPlayerMoney(playerid) >= CBombP){
- new string[120];
- pbData[playerid][CBomb]++;
- GivePlayerMoney(playerid, -CBombP);
- format(string, sizeof(string), "[EO_INFO]: {FFFFFF}You bought a Car Bomb for $%i, the use instructions via /ehelp",CBombP);
- SendClientMessage(playerid, 0xFFFF0088, string);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You can't afford this");
- }
- case 4:{
- if(GetPlayerMoney(playerid) >= ABombP){
- new string[120];
- pbData[playerid][ABomb]++;
- GivePlayerMoney(playerid, -ABombP);
- format(string, sizeof(string), "[EO_INFO]: {FFFFFF}You bought an Atomic Bomb for $%i, the use instructions via /ehelp",ABombP);
- SendClientMessage(playerid, 0xFFFF0088, string);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You can't afford this");
- }
- case 5:{
- if(GetPlayerMoney(playerid) >= SBombP){
- new string[120];
- pbData[playerid][SBomb]++;
- GivePlayerMoney(playerid, -SBombP);
- format(string, sizeof(string), "[EO_INFO]: {FFFFFF}You bought a Sticky Bomb for $%i, the use instructions via /ehelp",SBombP);
- SendClientMessage(playerid, 0xFFFF0088, string);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You can't afford this");
- }
- case 6:{
- if(GetPlayerMoney(playerid) >= SuBombP){
- new string[120];
- pbData[playerid][SuBomb]++;
- GivePlayerMoney(playerid, -SuBombP);
- format(string, sizeof(string), "[EO_INFO]: {FFFFFF}You bought a Suicidal Bomb vest for $%i, the use instructions via /ehelp",SuBombP);
- SendClientMessage(playerid, 0xFFFF0088, string);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You can't afford this");
- }
- case 7:{
- if(GetPlayerMoney(playerid) >= QBombP){
- new string[120];
- pbData[playerid][QBomb]++;
- GivePlayerMoney(playerid, -QBombP);
- format(string, sizeof(string), "[EO_INFO]: {FFFFFF}You bought a Quantum bomb for $%i, the use instructions via /ehelp",QBombP);
- SendClientMessage(playerid, 0xFFFF0088, string);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You can't afford this");
- }
- case 8:{
- if(GetPlayerMoney(playerid) >= MBombP){
- new string[120];
- pbData[playerid][MBomb]++;
- GivePlayerMoney(playerid, -MBombP);
- format(string, sizeof(string), "[EO_INFO]: {FFFFFF}You bought a Mine for $%i, the use instructions via /ehelp",MBombP);
- SendClientMessage(playerid, 0xFFFF0088, string);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You can't afford this");
- }
- case 9:{
- if(GetPlayerMoney(playerid) >= EBarrelP){
- new string[120];
- pbData[playerid][EBBomb]++;
- GivePlayerMoney(playerid, -EBarrelP);
- format(string, sizeof(string), "[EO_INFO]: {FFFFFF}You bought an explosive barrel for $%i, the use instructions via /ehelp",EBarrelP);
- SendClientMessage(playerid, 0xFFFF0088, string);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You can't afford this");
- }
- }
- }
- if(dialogid == DIALOG_TBomb){
- if(strval(inputtext)>60 || strval(inputtext)<3) return SendClientMessage(playerid, 0xFF000088, "[ERROR]: The seconds value must be closed between 3 and 60");
- pBombTimer[playerid] = SetTimerEx("TimingBombTimer",strval(inputtext)*1000, false, "i", playerid);
- GetPlayerPos(playerid, gC[0], gC[1], gC[2]);
- pBombPos[playerid][0] = gC[0];
- pBombPos[playerid][1] = gC[1];
- pBombPos[playerid][2] = gC[2];
- pBomb[playerid] = CreateObject(1252, gC[0], gC[1], gC[2], 0.0, 0.0,0.0);
- pbData[playerid][TBomb]--;
- pbData[playerid][BombUse] = false;
- pbData[playerid][BombEx] = true;
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment