Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- new bool: VeiculoBomba[MAX_VEHICLES];
- static Float: PosVeiculo[3];
- main()
- {
- print("\n----------------------------------");
- print(" Veiculo-Bomba carregado");
- print(" Por IlanZ");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- CreateVehicle(400, 0.0, 0.0, 2.5, 0, random(128), random(128), -1);
- CreateVehicle(400, 7, 0.0, 2.5, 0, random(128), random(128), -1);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerSkin(playerid, random(311));
- SetPlayerPos(playerid, 0, 0, 0);
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- if(VeiculoBomba[vehicleid] == true)
- {
- VeiculoBomba[vehicleid] = false;
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
- {
- if(VeiculoBomba[GetPlayerVehicleID(playerid)] == true)
- {
- SetTimerEx("ExplodirBomba", 5000, false, "i", playerid);
- SendClientMessage(playerid, -1, "Voce entrou em um carro com bomba plantada, e ira explodir em 5 segundos");
- SendClientMessage(playerid, -1, "Corra!");
- SetVehicleHealth(GetPlayerVehicleID(playerid), 0);
- GetVehiclePos(GetPlayerVehicleID(playerid),PosVeiculo[0], PosVeiculo[1],PosVeiculo[2]);
- }
- }
- return 1;
- }
- forward ExplodirBomba(playerid);
- public ExplodirBomba(playerid)
- {
- CreateExplosion(PosVeiculo[0]+1,PosVeiculo[1]+0.5, PosVeiculo[2],10,30.0);
- CreateExplosion(PosVeiculo[0]+5,PosVeiculo[1]+4, PosVeiculo[2],10,30.0);
- CreateExplosion(PosVeiculo[0]+7,PosVeiculo[1]+6, PosVeiculo[2]+4,10,30.0);
- return 1;
- }
- CMD:plantarbomba(playerid)
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "nao está em um carro");
- VeiculoBomba[GetPlayerVehicleID(playerid)] = true;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement