Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sistema de Homem Bomba by: BzK
- #include <a_samp>
- #include <zcmd>
- new AtivouHomemBomba[MAX_PLAYERS];
- new PegarBombaTimer[MAX_PLAYERS];
- new HomemBombaTimer[MAX_PLAYERS];
- forward Contador();
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Sistema de Homem Bomba by: BzK");
- print("--------------------------------------\n");
- SetTimer("Contador", 1000, true);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- AtivouHomemBomba[playerid] = 0;
- HomemBombaTimer[playerid] = 0;
- PegarBombaTimer[playerid] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- AtivouHomemBomba[playerid] = 0;
- return 1;
- }
- public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
- {
- if(AtivouHomemBomba[damagedid] == 1)
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(damagedid,x,y,z);
- CreateExplosion(x, y, z, 6, 2000.0);
- CreateExplosion(x+2, y+2, z+2, 6, 2000.0);
- CreateExplosion(x+3, y+3, z+3, 6, 2000.0);
- }
- return 1;
- }
- public Contador()
- {
- for(new i = 0; i <= MAX_PLAYERS; i++)
- {
- if(HomemBombaTimer[i] <= 0)
- HomemBombaTimer[i] = 0;
- else
- HomemBombaTimer[i] -= 1;
- if(PegarBombaTimer[i] <= 0)
- PegarBombaTimer[i] = 0;
- else
- PegarBombaTimer[i] -= 1;
- }
- }
- CMD:pegarbomba(playerid, params[])
- {
- #pragma unused params
- new stringloka[128];
- format(stringloka, 128, "[ERRO] Você já pegou uma bomba recentemente, espere mais %d segundos.", PegarBombaTimer[playerid]);
- if(PegarBombaTimer[playerid] > 0)
- return SendClientMessage(playerid, -1, stringloka);
- if(AtivouHomemBomba[playerid] == 1)
- return SendClientMessage(playerid, -1, "[Erro] Você já ativou a bomba.");
- SetPlayerAttachedObject(playerid, 7, 363, 17, -0.20622876, 0.19777177, 0.15666486, 103.44262695, 68.12296295, -108.56298065);
- SetPlayerAttachedObject(playerid, 8, 363, 17, -0.30122867, -0.09822817, 0.15766486, 104.04261779, 74.02297210, -105.86302185);
- AtivouHomemBomba[playerid] = 1;
- PegarBombaTimer[playerid] = 900;
- return 1;
- }
- CMD:homembomba(playerid, params[])
- {
- #pragma unused params
- new stringloka[128];
- format(stringloka, 128, "[ERRO] Você já se explodiu recentemente, espere mais %d segundos.", HomemBombaTimer[playerid]);
- if(HomemBombaTimer[playerid] > 0)
- return SendClientMessage(playerid, -1, stringloka);
- if(IsPlayerInAnyVehicle(playerid))
- return SendClientMessage(playerid, -1, "[Erro] Você não pode usar este comando dentro de um veículo.");
- if(AtivouHomemBomba[playerid] != 1)
- return SendClientMessage(playerid, -1, "[Erro] Você não pegou a bomba.");
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid, x, y, z);
- CreateExplosion(x, y, z, 6, 2000.0);
- CreateExplosion(x+2, y+2, z+2, 6, 2000.0);
- CreateExplosion(x+3, y+3, z+3, 6, 2000.0);
- SetPlayerHealth(playerid, 0);
- SetPlayerArmour(playerid, 0);
- HomemBombaTimer[playerid] = 900;
- SendClientMessage(playerid, -1, "[HOMEM BOMBA] Você se explodiu com sucesso!");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement