Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- |||||||||||||||||||||||||||||||||
- ||aBomb System By AlexzzPro ||
- ||Please keep the credits to me||
- ||Do not claim this as your own||
- ||Enjoy ||
- |||||||||||||||||||||||||||||||||
- */
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #define COLOR_RED 0xAA3333AA
- #define COLOR_GREEN 0x21DD00FF
- #define BombBuy 1
- new Planted[MAX_PLAYERS];
- new bombprice = 2500;
- new iBomb;
- new GotBombs[MAX_PLAYERS];
- new bombplanted[MAX_PLAYERS];
- forward bombtimer(playerid);
- new bombtime = 30000;
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" aBomb System By AlexzzPro");
- print("--------------------------------------\n");
- iBomb = CreatePickup(1252, 23, 1424.3972,-1319.2443,13.5547);
- return 1;
- }
- public OnFilterScriptExit()
- {
- DestroyPickup(iBomb);
- return 1;
- }
- #else
- #endif
- public bombtimer(playerid)
- {
- new Float:x,Float:y,Float:z;
- GetObjectPos(bombplanted[playerid],x,y,z);
- CreateExplosion(x,y,z,2,10.50);
- CreateExplosion(x,y,z,6,10.50);
- CreateExplosion(x,y,z,7,10.50);
- CreateExplosion(x,y,z,13,10.50);
- CreateExplosion(x,y,z,9,10.50);
- CreateExplosion(x,y,z,3,10.50);
- CreateExplosion(x,y,z,4,10.50);
- CreateExplosion(x,y,z,5,10.50);
- CreateExplosion(x,y,z,0,10.50);
- CreateExplosion(x,y,z,10,10.50);
- DestroyObject(bombplanted[playerid]);
- SetPlayerAttachedObject(playerid, 0, 363, 1, 0.300000, -0.14,0.2, 0.000000, 90, 359.5022,1,1,1);
- Planted[playerid] = 0;
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(GotBombs[playerid] == 0)
- {
- RemovePlayerAttachedObject(playerid,0);
- return 1;
- }
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == iBomb)
- {
- ShowPlayerDialog(playerid, BombBuy, DIALOG_STYLE_MSGBOX, "Purchase Bombs","Do you wish to purchase bombs for {FF0000}2500","Buy","No");
- return 1;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == BombBuy)
- {
- if(response)
- {
- if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, COLOR_RED, " You dont have $2500");
- {
- GotBombs[playerid] += 5;
- SendClientMessage(playerid, COLOR_GREEN, "You purchased 5 bombs for $2500");
- GivePlayerMoney(playerid, -bombprice);
- SetPlayerAttachedObject(playerid, 0, 363, 1, 0.300000, -0.14,0.2, 0.000000, 90, 359.5022,1,1,1);
- }
- }
- if(!response)
- {
- SendClientMessage(playerid, COLOR_RED, "Come back if you need bombs");
- }
- }
- return 1;
- }
- CMD:plantbomb(playerid,params[])
- {
- if(GotBombs[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_RED, "You dont have any bombs");
- return 1;
- }
- if(Planted[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_RED, "You already planted a bomb, wait for it to explode");
- return 1;
- }
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- bombplanted[playerid] = CreateObject(1252, x,y,z,0,0,0);
- GotBombs[playerid] =- 1;
- RemovePlayerAttachedObject(playerid,0);
- SetTimerEx("bombtimer", bombtime, false, "i", playerid);
- bombseconds(playerid);
- Planted[playerid] = 1;
- return 1;
- }
- stock bombseconds(playerid)
- {
- SendClientMessage(playerid, COLOR_GREEN, "Your bomb will explode in 30 seconds");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment