Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
- *
- * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
- * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
- *
- * Codigo Creado Por OTACON
- *
- * CREDITOS:
- * OTACON: Realizacion y Idea de creacion del code.
- * TÙ: Modificacion libremente respetando lo mencionado ;).
- *
- * NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
- *
- * Prohibido TOTALMENTE el Robo de Créditos o la
- * Publicación de este FILTERSCRIPT sin Mi Permiso.
- */
- /*
- * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
- *
- * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
- * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
- *
- * Code Created By OTACON
- *
- * CREDITS:
- * OTACON: Idea Making and code creation.
- * YOUR: Modification freely respecting the above ;).
- *
- * NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
- *
- * FULLY spaces Theft Credit or
- * Publication of this FILTERSCRIPT without my permission.
- */
- #include <a_samp>
- #include <zcmd>
- #include <player_progressbar>
- #define pressed(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- #define released(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
- #define COLOR_BAR_1 0xD9D9D9FF //white
- #define COLOR_BAR_2 0xB71700FF //red
- #define MAX_Bomb (5)
- #define ID_Bomb (1654)
- #define TIMER_BOOM (30)
- #define PAY_Bomb (1500)
- enum BombInfo {
- bool:BombActive,
- CantidadBomb,
- Float:PosBombX,
- Float:PosBombY,
- Float:PosBombZ,
- Float:PosBombA,
- PlacingKilling,
- ExploitingKilling,
- CountingBoom,
- BombObject, };
- new Bomb[MAX_PLAYERS][BombInfo];
- new PlayerBar:BarBomb[MAX_PLAYERS][2];
- new PlayerText:TextBomb[MAX_PLAYERS][3];
- public OnPlayerConnect(playerid) {
- new data[128];
- TextBomb[playerid][0]=CreatePlayerTextDraw(playerid,413.000000, 104.000000, "_");
- PlayerTextDrawBackgroundColor(playerid,TextBomb[playerid][0], 255);
- PlayerTextDrawFont(playerid,TextBomb[playerid][0], 1);
- PlayerTextDrawLetterSize(playerid,TextBomb[playerid][0], 0.270000, 1.300000);
- PlayerTextDrawColor(playerid,TextBomb[playerid][0], -1);
- PlayerTextDrawSetOutline(playerid,TextBomb[playerid][0], 1);
- PlayerTextDrawSetProportional(playerid,TextBomb[playerid][0], 1);
- PlayerTextDrawSetSelectable(playerid,TextBomb[playerid][0], 0);
- TextBomb[playerid][1]=CreatePlayerTextDraw(playerid,322.000000, 50.000000, "_");
- PlayerTextDrawAlignment(playerid,TextBomb[playerid][1], 2);
- PlayerTextDrawBackgroundColor(playerid,TextBomb[playerid][1], 255);
- PlayerTextDrawFont(playerid,TextBomb[playerid][1], 2);
- PlayerTextDrawLetterSize(playerid,TextBomb[playerid][1], 0.670000, 3.300000);
- PlayerTextDrawColor(playerid,TextBomb[playerid][1], -1);
- PlayerTextDrawSetOutline(playerid,TextBomb[playerid][1], 1);
- PlayerTextDrawSetProportional(playerid,TextBomb[playerid][1], 1);
- PlayerTextDrawUseBox(playerid,TextBomb[playerid][1], 1);
- PlayerTextDrawBoxColor(playerid,TextBomb[playerid][1], 0x0000155);
- PlayerTextDrawTextSize(playerid,TextBomb[playerid][1], 80.000000, 98.000000);
- PlayerTextDrawSetSelectable(playerid,TextBomb[playerid][1], 0);
- TextBomb[playerid][2]=CreatePlayerTextDraw(playerid,512.000000, 136.000000, "_");
- PlayerTextDrawAlignment(playerid,TextBomb[playerid][2], 2);
- PlayerTextDrawBackgroundColor(playerid,TextBomb[playerid][2], 255);
- PlayerTextDrawFont(playerid,TextBomb[playerid][2], 2);
- PlayerTextDrawLetterSize(playerid,TextBomb[playerid][2], 0.220000, 1.500000);
- PlayerTextDrawColor(playerid,TextBomb[playerid][2], -1);
- PlayerTextDrawSetOutline(playerid,TextBomb[playerid][2], 1);
- PlayerTextDrawSetProportional(playerid,TextBomb[playerid][2], 1);
- PlayerTextDrawSetSelectable(playerid,TextBomb[playerid][2], 0);
- format(data,sizeof(data), "~w~amount of bomb: ~g~%02d/%02d", Bomb[playerid][CantidadBomb], MAX_Bomb);
- PlayerTextDrawSetString(playerid,TextBomb[playerid][2], data);
- BarBomb[playerid][0]=CreatePlayerProgressBar(playerid, 503.000000, 110.000000, 55.500000, 3.200000, COLOR_BAR_1, 100.0);
- SetPlayerProgressBarMaxValue(playerid, BarBomb[playerid][0], 100.0);
- SetPlayerProgressBarValue(playerid, BarBomb[playerid][0], 0);
- BarBomb[playerid][1]=CreatePlayerProgressBar(playerid, 503.000000, 122.000000, 101.500000, 3.199999, COLOR_BAR_2, 100.0);
- SetPlayerProgressBarMaxValue(playerid, BarBomb[playerid][1], Float:float(TIMER_BOOM));
- SetPlayerProgressBarValue(playerid, BarBomb[playerid][1], Float:float(TIMER_BOOM));
- Bomb[playerid][BombActive]=false;
- Bomb[playerid][CountingBoom]=0;
- return true;
- }
- public OnPlayerDisconnect(playerid, reason) {
- HidePlayerProgressBar(playerid, BarBomb[playerid][0]);
- HidePlayerProgressBar(playerid, BarBomb[playerid][1]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][0]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][1]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][2]);
- KillTimer(Bomb[playerid][PlacingKilling]);
- KillTimer(Bomb[playerid][ExploitingKilling]);
- Bomb[playerid][BombActive]=false;
- Bomb[playerid][CountingBoom]=0;
- return true;
- }
- public OnPlayerDeath(playerid, killerid, reason) {
- HidePlayerProgressBar(playerid, BarBomb[playerid][0]);
- HidePlayerProgressBar(playerid, BarBomb[playerid][1]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][0]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][1]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][2]);
- KillTimer(Bomb[playerid][PlacingKilling]);
- KillTimer(Bomb[playerid][ExploitingKilling]);
- Bomb[playerid][BombActive]=false;
- Bomb[playerid][CountingBoom]=0;
- Bomb[playerid][CantidadBomb]=0;
- DestroyObject(Bomb[playerid][BombObject]);
- return true;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
- if(pressed(KEY_HANDBRAKE)) {
- switch(Bomb[playerid][BombActive]) {
- case true: {
- if(Bomb[playerid][CantidadBomb]<=0) return SendClientMessage(playerid, -1," [ ! ] You have to place bombs!.");
- ShowPlayerProgressBar(playerid, BarBomb[playerid][0]);
- PlayerTextDrawShow(playerid, TextBomb[playerid][0]);
- PlayerTextDrawSetString(playerid,TextBomb[playerid][0], "~w~Placing Bomb:");
- ApplyAnimation(playerid,"BOMBER","BOM_Plant_Crouch_In",4.1,0,1,1,1,1);
- Bomb[playerid][PlacingKilling]=SetTimerEx("PlacingBomb", 150, true, "d", playerid);
- GameTextForPlayer(playerid, "~n~~n~~n~~g~Placing Bomb...", 4000, 3);
- GetPlayerPos(playerid, Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ]);
- GetPlayerFacingAngle(playerid,Bomb[playerid][PosBombA]);
- DestroyObject(Bomb[playerid][BombObject]);
- Bomb[playerid][PosBombX] = Bomb[playerid][PosBombX] + (0.6 * floatsin(-Bomb[playerid][PosBombA], degrees));
- Bomb[playerid][PosBombY] = Bomb[playerid][PosBombY] + (0.6 * floatcos(-Bomb[playerid][PosBombA], degrees));
- Bomb[playerid][BombObject]=CreateObject(ID_Bomb, Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ]-0.8, 0.0, 0.0, Bomb[playerid][PosBombA]);
- }
- }
- }
- if(released(KEY_HANDBRAKE)) {
- switch(Bomb[playerid][BombActive]) {
- case true: {
- HidePlayerProgressBar(playerid, BarBomb[playerid][0]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][0]);
- ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
- KillTimer(Bomb[playerid][ExploitingKilling]);
- KillTimer(Bomb[playerid][PlacingKilling]);
- Bomb[playerid][CountingBoom]=0;
- DestroyObject(Bomb[playerid][BombObject]);
- }
- }
- } return true;
- }
- forward PlacingBomb(playerid);
- public PlacingBomb(playerid) {
- new data[100];
- Bomb[playerid][CountingBoom]++;
- SetPlayerProgressBarValue(playerid, BarBomb[playerid][0], Bomb[playerid][CountingBoom]);
- UpdatePlayerProgressBar(playerid, BarBomb[playerid][0]);
- if(Bomb[playerid][CountingBoom]>=100) {
- GameTextForPlayer(playerid, "~n~~n~~n~~g~Bomb Placed!", 4000, 3);
- Bomb[playerid][CountingBoom]=0;
- Bomb[playerid][CountingBoom]=TIMER_BOOM;
- Bomb[playerid][CantidadBomb]--;
- format(data,sizeof(data), "~w~amount of bomb: ~g~%02d/%02d", Bomb[playerid][CantidadBomb], MAX_Bomb);
- PlayerTextDrawSetString(playerid,TextBomb[playerid][2], data);
- HidePlayerProgressBar(playerid, BarBomb[playerid][0]);
- ShowPlayerProgressBar(playerid, BarBomb[playerid][1]);
- PlayerTextDrawShow(playerid, TextBomb[playerid][1]);
- PlayerTextDrawSetString(playerid,TextBomb[playerid][0], "~w~~n~Explosion time:");
- ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
- KillTimer(Bomb[playerid][PlacingKilling]);
- Bomb[playerid][ExploitingKilling]=SetTimerEx("ExplodingBomb", 1*1000, true, "d", playerid);
- Bomb[playerid][BombActive]=false;
- } return true;
- }
- forward ExplodingBomb(playerid);
- public ExplodingBomb(playerid) {
- new data[20];
- Bomb[playerid][CountingBoom]--;
- SetPlayerProgressBarValue(playerid, BarBomb[playerid][1], Bomb[playerid][CountingBoom]);
- UpdatePlayerProgressBar(playerid, BarBomb[playerid][1]);
- format(data,sizeof(data), "~w~00:%02d", Bomb[playerid][CountingBoom]);
- PlayerTextDrawSetString(playerid,TextBomb[playerid][1], data);
- PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
- if(Bomb[playerid][CountingBoom]<=0) {
- KillTimer(Bomb[playerid][ExploitingKilling]);
- KillTimer(Bomb[playerid][PlacingKilling]);
- Bomb[playerid][CountingBoom]=0;
- HidePlayerProgressBar(playerid, BarBomb[playerid][1]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][0]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][1]);
- DestroyObject(Bomb[playerid][BombObject]);
- GameTextForPlayer(playerid, "~n~~n~~n~~w~BOOM!!.", 4000, 3);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 1, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 2, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 3, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 4, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 5, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 6, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 7, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 8, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 9, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 10, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 11, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 12, 30.0);
- CreateExplosion(Bomb[playerid][PosBombX], Bomb[playerid][PosBombY], Bomb[playerid][PosBombZ], 13, 30.0);
- Bomb[playerid][BombActive]=true;
- } return true;
- }
- COMMAND:bomb(playerid, params[]) {
- switch(Bomb[playerid][BombActive]) {
- case false: {
- Bomb[playerid][BombActive]=true;
- PlayerTextDrawShow(playerid, TextBomb[playerid][2]);
- SendClientMessage(playerid, -1," [ ! ] You have activated the bomb system!.");
- }
- case true: {
- HidePlayerProgressBar(playerid, BarBomb[playerid][0]);
- HidePlayerProgressBar(playerid, BarBomb[playerid][1]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][0]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][1]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][2]);
- KillTimer(Bomb[playerid][PlacingKilling]);
- KillTimer(Bomb[playerid][ExploitingKilling]);
- Bomb[playerid][BombActive]=false;
- Bomb[playerid][CountingBoom]=0;
- DestroyObject(Bomb[playerid][BombObject]);
- PlayerTextDrawHide(playerid, TextBomb[playerid][2]);
- SendClientMessage(playerid, -1," [ ! ] You have disabled the bomb system!.");
- }
- } return true;
- }
- COMMAND:ammo(playerid, params[]) {
- if(Bomb[playerid][CantidadBomb]!=0) return SendClientMessage(playerid, -1," [ ! ] You still have to place bombs!.");
- if(GetPlayerMoney(playerid)<=0 || GetPlayerMoney(playerid)<PAY_Bomb) return SendClientMessage(playerid, -1," [ ! ] You do not have enough money to buy bombs!.");
- new data[100];
- Bomb[playerid][CantidadBomb]=MAX_Bomb;
- format(data,sizeof(data), " [ ! ] Make purchased a pack of %d bomb, por $%d - ($:%d x Bomb:%d)!.",MAX_Bomb,PAY_Bomb*MAX_Bomb,PAY_Bomb,MAX_Bomb);
- SendClientMessage(playerid, -1,data);
- GivePlayerMoney(playerid,(0-PAY_Bomb*MAX_Bomb));
- format(data,sizeof(data), "~w~amount of bomb: ~g~%02d/%02d", Bomb[playerid][CantidadBomb], MAX_Bomb);
- PlayerTextDrawSetString(playerid,TextBomb[playerid][2], data);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement