Advertisement
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,All credits must be sacred,
- and thus any attempt to include this on your server,
- you will have to credit me as well,
- =====================================================================================================================================================================
- =====================================================================================================================================================================
- ====================================================================================================================================================================*/
- #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_EO_Explosive Shop v0.1");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" EO_Explosive Shop by E.Oussama");
- print("----------------------------------\n");
- }
- #endif
- new Float:gC[3];
- new pBomb[MAX_PLAYERS];
- new pBombTimer[MAX_PLAYERS];
- new pABICheck[MAX_PLAYERS];
- new Float:pBombPos[MAX_PLAYERS][3];
- new Float:pABombPos[MAX_PLAYERS][3];
- //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,
- Bomb,
- TBomb,
- CBomb,
- ABomb,
- 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);
- /*=====================================================================================================================================================================
- =====================================================================================================================================================================
- ======================================================|| 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
- //Timers
- #define BrakingTimer 300000 //Timer between using each bomb
- #define VehicleBombClearTimer 300000 //Time to clear all vehicle car bombs
- /*=====================================================================================================================================================================
- ====================================================================================================================================================================*/
- public OnGameModeInit()
- {
- SetGameModeText("EO_Explosive Shop version 0.1 by EOussama");
- 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_Explosive Shop version 0.1 by EOussama");
- 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;
- 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;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- pbData[playerid][BombEx] = false;
- pbData[playerid][BombC4] = false;
- pbData[playerid][AtBomb] = false;
- pbData[playerid][Bomb] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- pbData[playerid][BombEx] = false;
- pbData[playerid][BombC4] = false;
- pbData[playerid][AtBomb] = false;
- pbData[playerid][Bomb] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(pbData[playerid][BombEx] == true){
- SendClientMessage(playerid, Red, "[EO_INFO]: The Bomb you planted has been deactivated");
- }
- pbData[playerid][BombEx] = false;
- pbData[playerid][BombC4] = false;
- pbData[playerid][AtBomb] = 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\tTiming Bombs: %i\tC4: %i\tCar Bomb: %i\nAtomic Bomb: %i",pname, pbData[playerid][Bomb],pbData[playerid][TBomb],pbData[playerid][C4],pbData[playerid][CBomb],pbData[playerid][ABomb]);
- 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[1000];
- 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");
- 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"
- ,"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");
- 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);
- 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, 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]+20,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]-2, pABombPos[playerid][2]-100, 7, 20);
- 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, 20);
- CreateExplosion(pABombPos[playerid][0]-30,pABombPos[playerid][1]+30, pABombPos[playerid][2]-100, 6, 20);
- CreateExplosion(pABombPos[playerid][0]+30,pABombPos[playerid][1]+0, pABombPos[playerid][2]-100, 6, 20);
- CreateExplosion(pABombPos[playerid][0]-30,pABombPos[playerid][1]+10, pABombPos[playerid][2]-100, 6, 20);
- CreateExplosion(pABombPos[playerid][0]-30,pABombPos[playerid][1]-30, pABombPos[playerid][2]-100, 6, 20);
- CreateExplosion(pABombPos[playerid][0]+20,pABombPos[playerid][1]-30, pABombPos[playerid][2]-100, 6, 20);
- 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);
- }
- }
- }
- }
- //////////////////////////////// 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][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) >= TBombP){
- pbData[playerid][Bomb]++;
- GivePlayerMoney(playerid, -TBombP);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You an't afford this");
- }
- case 1:{
- if(GetPlayerMoney(playerid) >= TBombP){
- pbData[playerid][TBomb]++;
- GivePlayerMoney(playerid, -TBombP);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You an't afford this");
- }
- case 2:{
- if(GetPlayerMoney(playerid) >= C4P){
- pbData[playerid][C4]++;
- GivePlayerMoney(playerid, -C4P);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You an't afford this");
- }
- case 3:{
- if(GetPlayerMoney(playerid) >= CBombP){
- pbData[playerid][CBomb]++;
- GivePlayerMoney(playerid, -CBombP);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You an't afford this");
- }
- case 4:{
- if(GetPlayerMoney(playerid) >= ABombP){
- pbData[playerid][ABomb]++;
- GivePlayerMoney(playerid, -ABombP);
- }
- else
- SendClientMessage(playerid, 0xFF000088, "[ERROR]: {FFFFFF}You an'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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement