Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a Toxic script by DaRk_RaiN
- //Change any part of the script to be sutable for you.
- #define FILTERSCRIPT
- //================[Includes]================
- #include <a_samp>
- #include <streamer>
- #include <fader>
- #include <COLORS>
- //================[Defines]================
- #if defined FILTERSCRIPT
- //================[Variables]================
- new UseNuke[MAX_PLAYERS];
- new NukeUser[MAX_PLAYERS];
- new NukeVictim[MAX_PLAYERS];
- //================================
- new NukeCp;
- new NukeZone;
- new Missile;
- //========[For the countdown]=======
- new CDT = 6;
- new CountDownTime;
- //================================
- public OnFilterScriptInit()
- {
- print("\n=======================================");
- print(" Toxic Bomb script by DaRk_RaiN loaded v1.1");
- print("=======================================\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- Seifader_OnExit();
- print("\n--------------------------------------");
- print(" Toxic Bomb script by DaRk_RaiN Unloaded");
- print("--------------------------------------\n");
- return 1;
- }
- #endif
- //================[Modifications when player connects]================
- public OnPlayerConnect(playerid)
- {
- NukeZone = GangZoneCreate(2440.3601, -1623.2374,2541.6348,-1721.8169);//This is a gang zone i added to make the detection of the target place easy.
- GangZoneShowForPlayer(playerid,NukeZone,COLOR_RED);
- SetPlayerMapIcon(playerid,547,1579.8275,-1635.1654,13.5612,23,COLOR_RED,MAPICON_GLOBAL);//change the x y z if you wanna use the nuke somewhere else(map icon)
- NukeCp = CreateDynamicCP(1579.8275,-1635.1654,13.5612, 1.0, -1, -1, -1, 100);//change the x y z if you wanna use the nuke somewhere else(Checkpoint)
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"Toxic bomb script by DaRk_RaiN use {FF8000}/area{80FF80}(to show the Toxic Bomb launch area)");
- SendClientMessage(playerid,COLOR_LIGHTBLUE," {FF8000}/Zone {80FF80}(to show the Target zone and {FF8000}/money{80FF80} (for testings))");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"{FF8000}/Money {80FF80}(to get 50.000$ for testing)");
- return 1;
- }
- //================[When the player spawns]================
- public OnPlayerSpawn(playerid)
- {
- SetPlayerWeather(playerid,5);
- return 1;
- }
- //================[Making all the variables none affective when player disconnects to avoid bugs]================
- public OnPlayerDisconnect(playerid, reason)
- {
- UseNuke[playerid]=0;//Avoiding bugs
- NukeUser[playerid]=0;
- NukeVictim[playerid]=0;
- return 1;
- }
- //================[When the player dies, this happenes]================
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(NukeVictim[playerid] == 1)//proventing OnPlayerDeath to send death message as the victim suisided
- {
- SetPlayerChatBubble(playerid, "Toxic Bomb Vicim", COLOR_RED, 100.0, 2000);
- GameTextForPlayer(playerid,"~r~~d~.::Choked::.~d~",1500,0);
- for(new i = 0; i < MAX_PLAYERS; i++)
- if(NukeUser[i] ==1)//for each victim the nuke user gets 3 scores
- {
- GivePlayerScore(i,3);
- }
- return 1;
- }
- SetPlayerWeather(playerid,5);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- //All these commands are for testing if you don't like them just erace.
- if (strcmp("/Money", cmdtext, true, 10) == 0)
- {
- GivePlayerMoney(playerid, 50000);
- return 1;
- }
- if (strcmp("/Area", cmdtext, true, 10) == 0)
- {
- SetPlayerPos(playerid, 1579.8275,-1635.1654,13.5612);
- return 1;
- }
- if (strcmp("/zone", cmdtext, true, 10) == 0)
- {
- SetPlayerPos(playerid, 2486.5623,-1670.7930,13.3359);
- return 1;
- }
- return 0;
- }
- //================[When the player enters the Toxic bomb check point]================
- public OnPlayerEnterDynamicCP(playerid, checkpointid)
- {
- if(checkpointid == NukeCp)
- {
- if(IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_RED,"*You need to leave the vehicle first");
- if(UseNuke[playerid] == 1)return SendClientMessage(playerid,COLOR_RED,"*You can't send a Toxic Bomb again, wait until feather notice");
- if(GetPlayerMoney(playerid) <49999)return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to launch{408080} Toxic Bomb(50.000$)");
- ShowPlayerDialog(playerid,555,DIALOG_STYLE_MSGBOX,"{800080}Nuke Area","Do you really want to buy and launch a {FF0000}Toxic Bomb?{0080C0} Cost:50.000$","Yes","No");
- return 1;
- }
- return 1;
- }
- //================[When the player leaves the checkpoint]================
- public OnPlayerLeaveDynamicCP(playerid, checkpointid)
- {
- if(checkpointid == NukeCp)
- {
- return 1;
- }
- return 1;
- }
- //================[The Toxic bomb dialog response]================
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new text[128];
- if(dialogid == 555 && response)//the dialog response
- {
- SendClientMessage(playerid,COLOR_RED,"You have launched a {FF8040}Toxic Bomb");
- format(text, sizeof(text), "====[{80FFFF}%s]{FF0000} has launched a{FF8040} Toxic Bomb====", Name(playerid));
- SendClientMessageToAll(COLOR_RED, text);
- UseNuke[playerid] =1;
- NukeUser[playerid] =1;
- CountDownTime = SetTimer("CountDown", 1000, 0);//The countdown timer
- SetTimerEx("Nuke1", 5000, 0, "i", playerid);
- SetTimer("Nuke01", 5500, 0);
- SetTimerEx("Nuke2", 10000, 0, "i", playerid);
- SetTimerEx("KillAll", 12500, 0, "i", playerid);
- SetTimerEx("Again", 60*1000, 0, "i", playerid);
- CountDownTime = SetTimer("Countdown",900,1);
- SetTimerEx("Weather", 14000, 0, "i", playerid);//2 minutes before using nuke again
- }
- return 1;
- }
- //================[Countdown system]================
- forward Weather(playerid);
- public Weather(playerid)
- {
- SetPlayerWeather(playerid,5);
- }
- forward Countdown();
- public Countdown()
- {
- CDT--;
- new string[128];
- if(CDT == 0)
- {
- KillTimer(CountDownTime);
- GameTextForAll("~r~Boom!",1000,6);
- CDT = 6;
- }
- else
- {
- format(string, sizeof(string), "~r~Bomb landing in:~b~%d", CDT);
- GameTextForAll(string, 1000, 6);
- }
- return 1;
- }
- //================[The first timer]================
- forward Nuke1(playerid);//In this part we flash the player screen
- public Nuke1(playerid)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)//looping the players
- {
- if(IsPlayerInRangeOfPoint(i,100,2486.5623,-1670.7930,13.3359))
- {
- FlashPlayerScreen(i, COLOR_RED, 6,1);
- }
- }
- Missile = CreateObject(3786, 2491.45, -1668.08, 45.91, 0.00, -90.00, 0.00);
- MoveObject(Missile,2491.45, -1668.08, 13.45,50 , 0.00, -90.00, 0.51);
- }
- //================[The second timer]================
- forward Nuke2(playerid);//Here we set his weather and edit the animation
- public Nuke2(playerid)
- {
- SetPlayerWeather(playerid, 165);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInRangeOfPoint(i,100,2486.5623,-1670.7930,13.3359))
- {
- SetPlayerWeather(i, 165);
- ApplyAnimation(i,"PED","KO_shot_stom",4.0,0,1,1,1,0);
- }
- }
- }
- forward Nuke01(playerid);//The explosion..
- public Nuke01(playerid)
- {
- CreateExplosion(2491.45, -1668.08, 13.45,6,1);
- DestroyObject(Missile);
- }
- //================[The timer that kills every one, and sends the death message]================
- forward KillAll(playerid);//Well you know what this does xD
- public KillAll(playerid)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInRangeOfPoint(i,100,2486.5623,-1670.7930,13.3359))//Checks if the player is in area
- {
- SetPlayerHealth(i, 0);
- NukeVictim[i]= 1;//Variable to detect if he is a toxic bomb victim
- }
- if(NukeUser[playerid] == 1 && NukeVictim[i] ==1)//Sending the death message
- {
- SendDeathMessage(playerid, i, 41);
- SetTimer("Autho", 5000, 0);
- }
- }
- }
- //================[To stop any bug from appearing]================
- forward Autho();//Avoid bugs when player dies
- public Autho()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- NukeVictim[i] = 0;
- NukeUser[i] = 0;
- }
- return 1;
- }
- //================[Make the player wait for two minutes before launching an other bomb]================
- forward Again(playerid);//to provent abuse of the toxic bomb
- public Again(playerid)
- {
- SendClientMessage(playerid,COLOR_GOLD,"You now can launch a {FF8040}Toxic Bomb {FFFF00}again.");
- UseNuke[playerid] =0;
- }
- //================[Stocks]================
- stock GivePlayerScore(playerid, score)//Stock for giving cash to player
- {
- SetPlayerScore(playerid, GetPlayerScore(playerid)+score);
- return 1;
- }
- stock Name(playerid)//Simple stock for player name
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- //end 283 lines
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement