/*************************************************************************** * plugin_call_ejl_sank_dice.sma Date: 10/17/2002 * See below fororiginal credits: Thanks to Eric Lidman and Luke Sankey * Modified to have more choices by: * Patrick Call patrickcall@sbcglobal.net * alias The |itt|e red dot on your head server: ConcMaps USA * * Patrick's changes are as follows: * Added beer to vision. * sets fov to make it look similiar to being drunk * added beer2 for chance of change in fov * while beer1 changes fov to many different things * beer2 doesn't (either can still kill or slap you) * [with extra thanks to Ludwig van for his idea of making a vision change from -1 to another or just * staying at -1, a possible chance either way] * also added total roll displayed and amount of time before next roll (if you try to roll before your allowed to * again) (everyone should be able to see it) * * dice rolls are now default * bomb 15% * stuck 15% * slap 1,2,and 3 are all 5% for a total 15% * glowing is 10% * god is 10% * nocllip 10% * zeus 5% * beer1 10% and beer2 10% for a total of 20% * decided to also add a 20% chance of kill and a 20% slap chance for drinking. **************************************************************************/ /************************************************************************** * plugin_sank_dice.sma Date: 03/07/2002 * See Below for the real credits: thanks once again to Luke Sankey * Modified to be even more fun by: * Eric Lidman ejlmozart@hotmail.com * Alias: Ludwig van Server: GNYSO-2 * * Eric's changes are as follows: * * Added "ZeusMode" (godmode and noclip combined) * Winners of ZeusMode, GodMode, and Noclip will now glow too * Replaced Slay with human time-bomb -- need admin_fx 1 in server.cfg * In this later version, timebomb can kill bystanders * Replaced Slap with slap disease -- possibly fatal * Enhanced Glow by having it potentially affect health * To Stuck I added a slap at the beginning -- looks funnier * Dead players cant gamble. * * * Rolls have changed from below, no need to go into detail. **************************************************************************/ /*************************************************************************** * plugin_sank_dice.sma * Author: Luke Sankey * Date November 27, 2001 * Last Modified: December 4, 2001 * * Fuctionality of this plugin: * It is a fun plugin to play dice. Users may gamble when admin_dice is set. * The sum of the numbers rolled determines what their fate is. The rewards * are as follows: * 2 or 12 Godmode * 3 or 11 Noclip * 4 or 10 Stuck * 5 or 9 Glow * 6 or 8 Slap * 7 Death * * My most deepest thanks goes to [SCR]Lightfoot-TA- (lightfoot_sf@yahoo.ca) * for he was the one who wrote the original, however buggy it may have been. ***************************************************************************/ // Functions included in this plugin // admin_dice <on|off> // say "roll the dice" or "I feel lucky" // Access required to enable gambling #define ACCESS_DICE 512 // Time of rewards, in seconds #define GODMODE_TIME 20 #define NOCLIP_TIME 20 #define STUCK_TIME 5 #define GLOW_TIME 15 #define DISEASE1_TIME 5 #define DISEASE2_TIME 10 #define DISEASE3_TIME 15 #define TIMEBOMB_TIME 10 #define ZEUSMODE_TIME 30 #define DRINK1_TIME 25 #define DRINK2_TIME 20 // Not actually in use untill fix can be set for binds #define BIND_TIME 30 // Delay required between gambling, in seconds #define GAMBLE_DELAY 60 /****************************************************************************/ /****************************************************************************/ /************** DO NOT MODIFY CONTENTS BELOW THIS LINE !!! ******************/ /************** DO NOT MODIFY CONTENTS BELOW THIS LINE !!! ******************/ /************** DO NOT MODIFY CONTENTS BELOW THIS LINE !!! ******************/ /****************************************************************************/ /****************************************************************************/ #include <core> #include <console> #include <string> #include <admin> #include <adminlib> new STRING_VERSION[MAX_DATA_LENGTH] = "2.51"; // Global variables indicating if dice games are enabled or not new bool:bGamesEnabled = true; new bool:bIsGambling = false; new LastGambleTime[MAX_PLAYERS+1]; new iTimebomb_Timer = 0; new BlowUpEarly = 0; new BombCorrectGuy; new BOMBKILL_RANGE = 500; /****************************************************************************/ /************************** Plugin Entry Point ******************************/ /****************************************************************************/ public plugin_init() { plugin_registerinfo("Roll The Dice Plugin", "Roll to win!.", STRING_VERSION); plugin_registercmd("say", "HandleSay", ACCESS_ALL); plugin_registercmd("admin_dice", "admin_dice", ACCESS_DICE, "admin_dice <on|off>: Turns dice games on or off."); return PLUGIN_CONTINUE; } public plugin_connect(HLUserName, HLIP, UserIndex) { if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS) LastGambleTime[UserIndex] = 0; return PLUGIN_CONTINUE; } /****************************************************************************/ /************************** User called functions ***************************/ /****************************************************************************/ public admin_dice(HLCommand, HLData, HLUserName, UserIndex) { new Data[MAX_DATA_LENGTH]; new User[MAX_NAME_LENGTH]; new Text[MAX_TEXT_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLData, Data, MAX_COMMAND_LENGTH); convert_string(HLUserName, User, MAX_NAME_LENGTH); if (check_param(Data) == 1) { bGamesEnabled = true; snprintf(Text, MAX_TEXT_LENGTH, "We are ready to commence torture!"); centersay(Text, 5, Red, Green, Blue); } else { bGamesEnabled = false; snprintf(Text, MAX_TEXT_LENGTH, "The TFC Gods are not receptive at this time."); centersay(Text, 5, Red, Green, Blue); } snprintf(Text, MAX_TEXT_LENGTH, "admin_dice %d", bGamesEnabled); selfmessage(Text); return PLUGIN_HANDLED; } public HandleSay(HLCommand, HLData, HLUserName, UserIndex) { new Data[MAX_DATA_LENGTH]; new User[MAX_NAME_LENGTH]; new Text[MAX_TEXT_LENGTH]; new Roll; new Red = random(256); new Green = random(256); new Blue = random(256); new X; new Y; new Z; convert_string(HLData, Data, MAX_DATA_LENGTH); convert_string(HLUserName, User, MAX_NAME_LENGTH); // Remove quotes, if there are any strstripquotes(Data); if ( ((strcasecmp(Data, "roll the dice") == 0) || (strcasecmp(Data, "i feel lucky") == 0)) && (bGamesEnabled == true) ) { new Name[MAX_NAME_LENGTH]; new SessionID, WONID; new UserTeam, UserDead; if (playerinfo(UserIndex, Name, MAX_NAME_LENGTH, SessionID, WONID, UserTeam, UserDead)){ // check to see if player is trying to gamble while dead if (UserDead != 0){ messageex(User, "<TFC Gods> If we can't torture dead people why would we dead people roll?", print_chat); return PLUGIN_CONTINUE; } else if (UserDead !=1){ new CurTime = systemtime(); new Amount = (GAMBLE_DELAY - (CurTime - LastGambleTime[UserIndex])); // Limit gambling frequency if (CurTime < (LastGambleTime[UserIndex] + GAMBLE_DELAY)) { snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> %s you are to greedy, you may not gamble for %d seconds", User, Amount); say(Text); return PLUGIN_CONTINUE; } else if (bIsGambling == true) { messageex(User, "<TFC Gods> We're already tormenting another poor soul, so WAIT YOU TURN!", print_chat); return PLUGIN_CONTINUE; } else { // Roll the dice new Dieone = random(10); Dieone++; new Dietwo = random(10); Dietwo++; // Calculate the total roll Roll = Dieone + Dietwo; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> %s rolled [%d] + [%d] = [%d]", User, Dieone, Dietwo, Roll); say(Text); if ((Roll == 9) || (Roll == 19)) { bIsGambling = true; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> Damn, %s won our strength.", User); godmode(User, 1); glow(User, Red, Green, Blue); set_timer("Godmode_Timer", 1, GODMODE_TIME); snprintf(Text, MAX_TEXT_LENGTH, "GodMode Winner:^n%s!!", User); centersay(Text, 3, Red, Green, Blue); } else if (Roll == 16) { // ZeusMode is noclip, godmode, and glow all rolled into one. Loads of fun. bIsGambling = true; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> HELL, %s won chance to be one of us!! (Godmode and Noclip together)", User); godmode(User, 1); noclip(User, 1); glow(User, Red, Green, Blue); set_timer("Zeusmode_Timer", 1, ZEUSMODE_TIME); snprintf(Text, MAX_TEXT_LENGTH, "ZeusMode Winner:^n%s!!", User); centersay(Text, 3, Red, Green, Blue); } else if ((Roll == 17) || (Roll == 7)) { bIsGambling = true; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> Why can't you roll 11 %s? Why did you have to win Noclip?", User); noclip(User, 1); glow(User, Red, Green, Blue); set_timer("Noclip_Timer", 1, NOCLIP_TIME); snprintf(Text, MAX_TEXT_LENGTH, "Noclip Winner:^n%s!!", User); centersay(Text, 3, Red, Green, Blue); } else if (Roll == 11) { bIsGambling = true; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> Unfortunately for %s, drinking is not good for your health.", User); execclient(User, "fov -90"); glow(User, Red, Green, Blue); set_timer("Drink1_Timer", 1, DRINK1_TIME); snprintf(Text, MAX_TEXT_LENGTH, "Beer Winner:^n%s!!", User); centersay(Text, 3, Red, Green, Blue); } else if ((Roll == 8) || (Roll == 18)) { bIsGambling = true; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> Unfortunately for %s, drinking is not good for your health.", User); execclient(User, "fov -90"); glow(User, Red, Green, Blue); set_timer("Drink2_Timer", 1, DRINK2_TIME); snprintf(Text, MAX_TEXT_LENGTH, "Beer Winner:^n%s!!", User); centersay(Text, 3, Red, Green, Blue); } else if ((Roll == 12) || (Roll == 15)) { bIsGambling = true; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> %s lost, and is stuck!", User); slap(User); get_userorigin(User, X, Y, Z); Z -= 40; teleport(User, X, Y, Z); set_timer("Stuck_Timer", 1, STUCK_TIME); } else if ((Roll == 10) || (Roll == 20)) { // Glowing isnt enough, we need an edge to it. Its gotta be dangerous to be fun. bIsGambling = true; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> Nice, %s is glowing! Lets see if he gets hurt.", User); glow(User, Red, Green, Blue); set_timer("Glow_Timer", 1, GLOW_TIME); } else if ((Roll == 2) || (Roll == 5)) { // Slap disease. LOL. 3 different varieties bIsGambling = true; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> %s has contracted ehmm.. been granted the deadly slap disease!", User); slap(User); set_timer("Disease1_Timer", 1, DISEASE1_TIME); } else if ((Roll == 4) || (Roll == 3)) { bIsGambling = true; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> %s has contracted ehmm.. been granted the deadly slap disease!", User); slap(User); set_timer("Disease2_Timer", 1, DISEASE2_TIME); } else if (Roll == 6) { bIsGambling = true; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> %s has contracted ehmm.. been granted the deadly slap disease!", User); slap(User); set_timer("Disease3_Timer", 1, DISEASE3_TIME); } else if ((Roll == 13) || (Roll == 14)) { // Ahh, the timebomb. BombCorrectGuy = UserIndex; bIsGambling = true; snprintf(Text, MAX_TEXT_LENGTH, "<TFC Gods> %s is now a human time-bomb! Everyone FIND him to make a good sacrifice.", User); // set up a loop to tell all players about the bomb with half-life sounds new i; new iMaxPlayers = maxplayercount(); for (i = 1; i <= iMaxPlayers; i++) { if (playerinfo(i,Name,MAX_NAME_LENGTH) == 1) { execclient(Name, "speak ^"warning _comma detonation device activated^""); } } glow(User, Red, Green, Blue); iTimebomb_Timer = set_timer("Timebomb_Timer", 1, TIMEBOMB_TIME); } LastGambleTime[UserIndex] = CurTime; say(Text); } } return PLUGIN_CONTINUE; } } return PLUGIN_CONTINUE; } /****************************************************************************/ /*************************** Timer Functions ********************************/ /****************************************************************************/ public Glow_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUserName, User, MAX_NAME_LENGTH); if (Repeat-1 == 0) { // gowing itself can be a gamble -- 9 percent chance of death glow(User, 0, 0, 0); new rand = random(9); switch(rand) { case 0: say ("You mortals glow to safely."); case 1: say ("You mortals glow to safely."); case 2: { slap(User); say("Ouch, glowing hurts."); } case 3: say ("You mortals glow to safely."); case 4: say ("You mortals glow to safely."); case 5: { slay(User); say("Glowing is good, it brought us fresh meat."); } case 6: say ("You mortals glow to safely."); case 7: { slap(User); say("Try that again, might make good sacrifice."); } case 8: say ("You mortals glow to safely."); } snprintf(Text, MAX_TEXT_LENGTH, "%s is no longer glowing", User); bIsGambling = false; } else { glow(User, Red, Green, Blue); snprintf(Text, MAX_TEXT_LENGTH, "%s is glowing for %d", User, Repeat-1); } typesay(Text, 1, Red, Green, Blue); } public Godmode_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUserName, User, MAX_NAME_LENGTH); if (Repeat-1 == 0) { glow(User, 0, 0, 0); godmode(User, 0); snprintf(Text, MAX_TEXT_LENGTH, "%s no longer has Godmode", User); bIsGambling = false; } else { glow(User, Red, Green, Blue); snprintf(Text, MAX_TEXT_LENGTH, "%s has Godmode for %d", User, Repeat-1); } typesay(Text, 1, Red, Green, Blue); } public Drink1_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUserName, User, MAX_NAME_LENGTH); if (Repeat-1 == 0) { glow(User, 0, 0, 0); new rand = random(5); switch(rand) { case 0: { slap(User); say("You had a tough time sobering up."); snprintf(Text, MAX_TEXT_LENGTH, "%s had a tough time sobering up.", User); } case 1: { say ("Your body has cleaned itself of the alcohol."); snprintf(Text, MAX_TEXT_LENGTH, "%s has now sobered up.", User); } case 2: { say ("Your body has cleaned itself of the alcohol."); snprintf(Text, MAX_TEXT_LENGTH, "%s has now sobered up.", User); } case 3: { slay(User); say("You drank to much and your body was overcome by alcohol."); snprintf(Text, MAX_TEXT_LENGTH, "%s has lost their life to drinking.", User); } case 4: { say("Your body has cleaned itself of the alcohol."); snprintf(Text, MAX_TEXT_LENGTH, "%s has now sobered up.", User); } } execclient(User, "fov 90"); bIsGambling = false; } else { glow(User, Red, Green, Blue); new rand = random(6); switch(rand) { case 0: { execclient(User, "fov -1"); } case 1: { execclient(User, "fov 10"); } case 2: { execclient(User, "fov 20"); } case 3: { execclient(User, "fov 30"); } case 4: { execclient(User, "fov -1"); } case 5: { execclient(User, "fov -1"); } } snprintf(Text, MAX_TEXT_LENGTH, "%s has hangover for %d", User, Repeat-1); } typesay(Text, 1, Red, Green, Blue); } public Drink2_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUserName, User, MAX_NAME_LENGTH); if (Repeat-1 == 0) { glow(User, 0, 0, 0); new rand = random(5); switch(rand) { case 0: { slap(User); say("You had a tough time sobering up."); snprintf(Text, MAX_TEXT_LENGTH, "%s had a tough time sobering up.", User); } case 1: { say ("Your body has cleaned itself of the alcohol."); snprintf(Text, MAX_TEXT_LENGTH, "%s has now sobered up.", User); } case 2: { say ("Your body has cleaned itself of the alcohol."); snprintf(Text, MAX_TEXT_LENGTH, "%s has now sobered up.", User); } case 3: { slay(User); say("You drank to much and your body was overcome by alcohol."); snprintf(Text, MAX_TEXT_LENGTH, "%s has lost their life to drinking.", User); } case 4: { say("Your body has cleaned itself of the alcohol."); snprintf(Text, MAX_TEXT_LENGTH, "%s has now sobered up.", User); } } execclient(User, "fov 90"); bIsGambling = false; } else { glow(User, Red, Green, Blue); execclient(User, "fov -90"); snprintf(Text, MAX_TEXT_LENGTH, "%s has hangover for %d", User, Repeat-1); } typesay(Text, 1, Red, Green, Blue); } public Bind_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUserName, User, MAX_NAME_LENGTH); if (Repeat-1 == 0) { //still not being used for the fact that buttons that were in use can't be returned to what they were //prior to binding kill (these are TFC defaults) glow(User, 0, 0, 0); execclient(User, "bind enter +attack"); execclient(User, "bind ` toggleconsole"); execclient(User, "bind f +gren1"); execclient(User, "bind g +gren2"); execclient(User, "bind i flaginfo"); execclient(User, "bind k +voicerecord"); execclient(User, "bind m +det5"); execclient(User, "bind n changeteam"); execclient(User, "bind a +moveleft"); execclient(User, "bind w +forward"); execclient(User, "bind d +moveright"); execclient(User, "bind q lastinv"); execclient(User, "bind r +reload"); execclient(User, "bind s +back"); execclient(User, "bind u messagemode2"); execclient(User, "bind y messagemode"); execclient(User, "bind ~ toggleconsole"); execclient(User, "bind mwheeldown invnext"); execclient(User, "bind mwheelup invprev"); execclient(User, "bind mouse1 +attack"); execclient(User, "bind mouse2 +attack2"); snprintf(Text, MAX_TEXT_LENGTH, "%s no longer has BIND", User); bIsGambling = false; } else { glow(User, Red, Green, Blue); snprintf(Text, MAX_TEXT_LENGTH, "%s has Bind for %d", User, Repeat-1); } typesay(Text, 1, Red, Green, Blue); } public Zeusmode_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUserName, User, MAX_NAME_LENGTH); if (Repeat-1 == 0) { godmode(User, 0); noclip(User, 0); glow(User, 0, 0, 0); snprintf(Text, MAX_TEXT_LENGTH, "%s no longer has ZeusMode", User); bIsGambling = false; } else { glow(User, Red, Green, Blue); snprintf(Text, MAX_TEXT_LENGTH, "%s has ZeusMode for %d", User, Repeat-1); } typesay(Text, 1, Red, Green, Blue); } public Noclip_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUserName, User, MAX_NAME_LENGTH); if (Repeat-1 == 0) { noclip(User, 0); glow(User, 0, 0, 0); snprintf(Text, MAX_TEXT_LENGTH, "%s no longer has Noclip", User); bIsGambling = false; } else { glow(User, Red, Green, Blue); snprintf(Text, MAX_TEXT_LENGTH, "%s has Noclip for %d", User, Repeat-1); } typesay(Text, 1, Red, Green, Blue); } public Stuck_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); new X; new Y; new Z; convert_string(HLUserName, User, MAX_NAME_LENGTH); if (Repeat-1 == 0) { get_userorigin(User, X, Y, Z); Z += 50; teleport(User, X, Y, Z); snprintf(Text, MAX_TEXT_LENGTH, "%s has been unstuck", User); bIsGambling = false; } else { snprintf(Text, MAX_TEXT_LENGTH, "%s has been stuck for %d", User, Repeat-1); } typesay(Text, 1, Red, Green, Blue); } public Disease1_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUserName, User, MAX_NAME_LENGTH); if (Repeat-1 == 0) { // set up the random possibility of being slayed after being slapped around new rand = random(2); switch(rand) { case 0: { snprintf(Text, MAX_TEXT_LENGTH, "Slap disease has left %s.", User); typesay(Text, 1, Red, Green, Blue); say("Slap disease can be fatal sometimes."); bIsGambling = false; } case 1: { slay(User); snprintf(Text, MAX_TEXT_LENGTH, "Slap disease has killed %s", User); typesay(Text, 1, Red, Green, Blue); say("Slap disease has earned us another sacrifice."); bIsGambling = false; } } } else { slap(User); snprintf(Text, MAX_TEXT_LENGTH, "%s has slap disease for %d", User, Repeat-1); typesay(Text, 1, Red, Green, Blue); } } public Disease2_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUserName, User, MAX_NAME_LENGTH); if (Repeat-1 == 0) { snprintf(Text, MAX_TEXT_LENGTH, "Slap disease has left %s.", User); typesay(Text, 1, Red, Green, Blue); say("Slap disease can be fatal sometimes."); bIsGambling = false; } else { slap(User); snprintf(Text, MAX_TEXT_LENGTH, "%s has slap disease for %d", User, Repeat-1); typesay(Text, 1, Red, Green, Blue); } } public Disease3_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUserName, User, MAX_NAME_LENGTH); if (Repeat-1 == 0) { snprintf(Text, MAX_TEXT_LENGTH, "Slap disease has left %s.", User); typesay(Text, 1, Red, Green, Blue); say("Slap disease can be fatal sometimes."); bIsGambling = false; } else { slap(User); snprintf(Text, MAX_TEXT_LENGTH, "%s has slap disease for %d", User, Repeat-1); typesay(Text, 1, Red, Green, Blue); } } public Timebomb_Timer(Timer, Repeat, HLUserName, HLParam) { new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Countdown[MAX_TEXT_LENGTH]; new i; new iMaxPlayers = maxplayercount(); new Name[MAX_NAME_LENGTH]; new COUNTSPEAK[MAX_TEXT_LENGTH]; new C4_SOUND[MAX_TEXT_LENGTH]; new C4_BEEP[MAX_TEXT_LENGTH]; new Dead; new maxplayers = maxplayercount(); new SessionID; new Team; new WONID; new x,y,z; new X,Y,Z; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUserName, User, MAX_NAME_LENGTH); // go right to the blowup part if player is dead (blowupearly=1) if (BlowUpEarly == 1){ Repeat = 1; } if (Repeat-1 == 0) { // set up a loop to find out where everyone is. Too close to the bomb and we kill them. for (i=1; i<=maxplayers; i++) { if( playerinfo(i,Name,MAX_NAME_LENGTH,SessionID,WONID,Team,Dead)!=0){ // we ignore dead players if(i == BombCorrectGuy){ User = Name; } // find em --- X is bomb x is all other players 1 at a time get_userorigin(User, X, Y, Z); get_userorigin(Name,x,y,z); if( ! (X-x > BOMBKILL_RANGE || X-x < - BOMBKILL_RANGE || Y-y > BOMBKILL_RANGE || Y-y < - BOMBKILL_RANGE || Z-z > BOMBKILL_RANGE || Z-z < - BOMBKILL_RANGE) ){ if(Dead==0) { messageex(Name, "<TFC Gods> Thank you for the sacrifice, make sure you sacrifice your OWN life next time.", print_chat); slay(Name); } } } } snprintf(Text, MAX_TEXT_LENGTH, "%s has exploded.", User); BombCorrectGuy = 0; glow(User, 0, 0, 0); bIsGambling = false; BlowUpEarly = 0; kill_timer(iTimebomb_Timer); } else { // gotta love this countdown // find out if the bomb guy is dead and set blowupearly to 1 if he is dead // if timer is higer than 13, them only one beep per second from c4 timer if (Repeat >= 13){ for (i = 1; i <= iMaxPlayers; i++) { if (playerinfo(i,Name,MAX_NAME_LENGTH, SessionID, WONID, Team, Dead) == 1) { if (!strcmp(User, Name)){ if (Dead != 0){ BlowUpEarly = 1; } } // find everyone X is bomb, x is everyone else (one at a time) // tells who should hear the c4 timer and then makes them hear it get_userorigin(User, X, Y, Z); get_userorigin(Name,x,y,z); if( ! (X-x > BOMBKILL_RANGE || X-x < - BOMBKILL_RANGE || Y-y > BOMBKILL_RANGE || Y-y < - BOMBKILL_RANGE || Z-z > BOMBKILL_RANGE || Z-z < - BOMBKILL_RANGE) ){ playsound(Name, "weapons/c4_beep1.wav"); } } } snprintf(Text, MAX_TEXT_LENGTH, "%s will explode in %d", User, Repeat-1); glow(User, Red, Green, Blue); typesay(Text, 1, Red, Green, Blue); return PLUGIN_CONTINUE; } // tell what words to say during countdown // set the c4 beep sound to get more intense as timer progresses if (Repeat == 12){ strcpy(Countdown, "remaining", 20); strcpy(C4_BEEP, "weapons/c4_beep1.wav", 30); } if (Repeat == 11){ strcpy(Countdown, "ten", 10); strcpy(C4_BEEP, "weapons/c4_beep1.wav", 30); } if (Repeat == 10){ strcpy(Countdown, "nine", 10); strcpy(C4_BEEP, "weapons/c4_beep1.wav", 30); } if (Repeat == 9){ strcpy(Countdown, "eight", 10); strcpy(C4_BEEP, "weapons/c4_beep1.wav", 30); } if (Repeat == 8){ strcpy(Countdown, "seven", 10); strcpy(C4_BEEP, "weapons/c4_beep2.wav", 30); } if (Repeat == 7){ strcpy(Countdown, "six", 10); strcpy(C4_BEEP, "weapons/c4_beep2.wav", 30); } if (Repeat == 6){ strcpy(Countdown, "five", 10); strcpy(C4_BEEP, "weapons/c4_beep4.wav", 30); } if (Repeat == 5){ strcpy(Countdown, "four", 10); strcpy(C4_BEEP, "weapons/c4_beep4.wav", 30); } if (Repeat == 4){ strcpy(Countdown, "three", 10); strcpy(C4_BEEP, "weapons/c4_beep4.wav", 30); } if (Repeat == 3){ strcpy(Countdown, "two", 10); strcpy(C4_BEEP, "weapons/c4_beep5.wav", 30); } if (Repeat == 2){ strcpy(Countdown, "one", 10); strcpy(C4_BEEP, "weapons/c4_beep5.wav", 30); } if (Repeat == 1){ return PLUGIN_CONTINUE; } snprintf(COUNTSPEAK, MAX_DATA_LENGTH, "speak ^"fvox/%s^"", Countdown); snprintf(C4_SOUND, MAX_DATA_LENGTH, "^"%s^"", C4_BEEP); // two birds with one stone in this loop // we speak the words to all the clients, and find out if our bomb is dead so we can // blow him up early and skip the rest of the countdown for (i = 1; i <= iMaxPlayers; i++) { if (playerinfo(i,Name,MAX_NAME_LENGTH, SessionID, WONID, Team, Dead) == 1) { if(i == BombCorrectGuy){ User = Name; } if (!strcmp(User, Name)){ if (Dead != 0){ BlowUpEarly = 1; } } // find everyone X is bomb, x is everyone else (one at a time) // find out who should hear the c4 timer sound then make them hear it get_userorigin(User, X, Y, Z); get_userorigin(Name,x,y,z); if( ! (X-x > BOMBKILL_RANGE || X-x < - BOMBKILL_RANGE || Y-y > BOMBKILL_RANGE || Y-y < - BOMBKILL_RANGE || Z-z > BOMBKILL_RANGE || Z-z < - BOMBKILL_RANGE) ){ playsound(Name, C4_SOUND); } execclient(Name, COUNTSPEAK); } } snprintf(Text, MAX_TEXT_LENGTH, "%s will explode in %d", User, Repeat-1); glow(User, Red, Green, Blue); typesay(Text, 1, Red, Green, Blue); } return PLUGIN_CONTINUE; }