Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ************************************
- * -Filterscript- *
- * Bomba Relógio v1 *
- * ______________________ *
- * Feito por: Bruno Mikio *
- ************************************
- /====================================\
- | VISITE: WWW.SAMPPAWNO.BLOGSPOT.COM |
- \====================================/
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- |___|
- */
- //~ ** CONFIGURAÇÂO ** ~//
- #define BOMBATEMPO 30 // O Tempo que levará para a bomba explodir (em segundos).
- #define ARMARTEMPO 6 // O Tempo que levará para armar a bomba (em segundos).
- //~ ** INCLUDES ** ~//
- #include <a_samp>
- //~ ** CORES ** ~//
- #define Amarelo 0xFFFF00AA
- //~ ** OUTROS ** ~//
- new BombaRelogio[MAX_PLAYERS];
- new MS[MAX_PLAYERS];
- new Segundos[MAX_PLAYERS];
- new Minutos[MAX_PLAYERS];
- new Float:BombX, Float:BombY, Float:BombZ;
- new bombplanttime;
- new bombtime;
- new PlantouBomba[MAX_PLAYERS];
- new Text:BombCount;
- forward BombTime(playerid);
- forward BombPlantTime(playerid);
- //-----------------------------------------------------------------------------------------------------------------//
- public OnFilterScriptInit()
- {
- BombCount = TextDrawCreate(270.000000, 397.000000, "00:00:00");
- TextDrawBackgroundColor(BombCount, 255);
- TextDrawFont(BombCount, 2);
- TextDrawLetterSize(BombCount, 0.500000, 2.199999);
- TextDrawColor(BombCount, -1);
- TextDrawSetOutline(BombCount, 1);
- TextDrawSetProportional(BombCount, 1);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/bomba", true) == 0)
- {
- if(PlantouBomba[playerid] == 1) return SendClientMessage(playerid, Amarelo, " Você já plantou uma bomba. ");
- else
- {
- bombplanttime = SetTimerEx("BombPlantTime", ARMARTEMPO*1000, 0, "d", playerid);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0);
- PlantouBomba[playerid] = 1;
- return 1;
- }
- }
- return 0;
- }
- public BombPlantTime(playerid)
- {
- GetPlayerPos(playerid, BombX, BombY, BombZ);
- BombaRelogio[playerid] = CreateObject(1252, BombX, BombY, BombZ-0.80, 270, 0, 0);
- TogglePlayerControllable(playerid, 1);
- ClearAnimations(playerid);
- bombtime = SetTimerEx("BombTime", 9, 1, "d", playerid);
- MS[playerid] = 99;
- Segundos[playerid] = BOMBATEMPO;
- TextDrawShowForAll(Text:BombCount);
- KillTimer(bombplanttime);
- return 1;
- }
- public BombTime(playerid)
- {
- MS[playerid]--;
- if(MS[playerid] == 0)
- {
- MS[playerid] = 99;
- Segundos[playerid]--;
- }
- if(Segundos[playerid] > 60)
- {
- new Segundos2 = Segundos[playerid] - 60;
- Segundos[playerid] = Segundos2;
- Minutos[playerid]++;
- }
- if(Segundos[playerid] == 0 && Minutos[playerid] > 0)
- {
- Segundos[playerid] = 59;
- Minutos[playerid]--;
- }
- if(Segundos[playerid] == 0 && MS[playerid] == 1)
- {
- PlantouBomba[playerid] = 0;
- TextDrawHideForAll(Text:BombCount);
- DestroyObject(BombaRelogio[playerid]);
- CreateExplosion(BombX, BombY + random(8), BombZ + random(5), 6, 10.0);
- CreateExplosion(BombX + random(8), BombY, BombZ + random(5), 6, 10.0);
- CreateExplosion(BombX, BombY, BombZ, 6, 10.0);
- CreateExplosion(BombX, BombY - random(8), BombZ + random(5), 6, 10.0);
- CreateExplosion(BombX - random(8), BombY, BombZ + random(5), 6, 10.0);
- KillTimer(bombtime);
- }
- if(Segundos[playerid] < 10)
- {
- new count[10];
- format(count, sizeof(count), "00:0%i:%i", Segundos[playerid], MS[playerid]);
- TextDrawSetString(BombCount, count);
- }
- if(Segundos[playerid] >= 10)
- {
- new count[10];
- format(count, sizeof(count), "00:%i:%i", Segundos[playerid], MS[playerid]);
- TextDrawSetString(BombCount, count);
- }
- if(Minutos[playerid] < 10 && Segundos[playerid] < 10)
- {
- new count[10];
- format(count, sizeof(count), "0%i:0%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
- TextDrawSetString(BombCount, count);
- }
- if(Minutos[playerid] < 10 && Segundos[playerid] > 9)
- {
- new count[10];
- format(count, sizeof(count), "0%i:%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
- TextDrawSetString(BombCount, count);
- }
- if(Minutos[playerid] >= 10 && Segundos[playerid] > 9)
- {
- new count[10];
- format(count, sizeof(count), "%i:%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
- TextDrawSetString(BombCount, count);
- }
- if(Minutos[playerid] >= 10 && Segundos[playerid] < 10)
- {
- new count[10];
- format(count, sizeof(count), "%i:0%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
- TextDrawSetString(BombCount, count);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement