Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 115.76 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /***************************************************************************************
  2.  * roll_the_dice.sma                    Version: 2.5 RC 4               Date: 05/01/2006
  3.  *
  4.  *   Idea by Ludwig van
  5.  *   Developed by Striker
  6.  *  
  7.  *   Offical Thread: http://www.amxmodx.org/forums/viewtopic.php?t=18554
  8.  *
  9.  *  ------------------------------------------------------------------------------------
  10.  *
  11.  *  This is another roll the dice plugin with some different and more advanced options.
  12.  *  There are gambling limits, admin controls, lots of FX and new features.
  13.  *
  14.  *  Prizes include:
  15.  *
  16.  *    - The Wild Ride
  17.  *    - A Lightsabre
  18.  *    - Smoking Drunkard
  19.  *    - Slap Disease (possible death)
  20.  *    - Zeusmode (Godmode,Maxspeed,Noclip combined, antistuck-teleport if you get stuck you will be teleported)
  21.  *    - Old Man (makes you slow)
  22.  *    - Race Car in The Red (makes you fast, very fast, beep beep!!)
  23.  *    - Invisible Man (invisble, maxspeed)
  24.  *    - Invisible God (invisble, maxspeed, and godmode)
  25.  *    - 100 Chickens (if u have Chicken model, but headcrabs if u haven't it)
  26.  *    - Win Health
  27.  *    - Timebomb
  28.  *    - Noclip (antistuck-kill: if you get stuck you will die)
  29.  *    - Godmode
  30.  *    - NightClub
  31.  *    - Burning
  32.  *    - Win XP (war3ft mod or superhero mod)
  33.  *    - Lose XP (war3ft mod or superhero mod)
  34.  *    - Win Money (random)
  35.  *    - Lose Money ($0)
  36.  *    - Headcrab Monsters
  37.  *    - Full Equipment
  38.  *    - Hit by Lightning
  39.  *    - Unlimited Ammo
  40.  *    - Go Blind
  41.  *    - Rambo (Para, Unlimited Ammo)
  42.  *
  43.  *  CVARs:
  44.  *
  45.  *    amx_dice_delay <180>      : (CVAR)        (Default = 180)                 Sets the time players have to wait before gambling again
  46.  *                                                                              (Set either in amxx.cfg or by amx_cvar command)
  47.  *    amx_dice_monstermod <1|0> : (CVAR)        (Default = 0)                   Enable/Disable Monstermod support
  48.  *                                                                              (You need activate monstermod to use this option)
  49.  *    amx_dice_admin <1|0>      : (CVAR)        (Default = 0)                   Enable/Disable amx_dice_delay for admins
  50.  *                                                                              (use ADMIN_ACCESS to set the flag)
  51.  *    amx_dice_statictimes <1|0>: (CVAR)        (Default = 0)                   Switch between static- and random-times for prizes
  52.  *    amx_dice_debug <0|1|2>:     (CVAR)        (Default = 0)                   Enable/Disable Debug Mode
  53.  *                                                                                      0 = No Debug
  54.  *                                                                                      1 = Normal Debug
  55.  *                                                                                      2 = Advanced Debug
  56.  *
  57.  *
  58.  *  Use this CVARS when 'amx_dice_statictimes' is ENABLED:
  59.  *
  60.  *    amx_dice_nightclubtime <15>       (Default = 15)          Sets the prize-time of NightClub
  61.  *    amx_dice_slaptime <12>            (Default = 12)          Sets the prize-time of Slap Disease
  62.  *    amx_dice_oldmantime <10>          (Default = 10)          Sets the prize-time of Old Man
  63.  *    amx_dice_humanbombtime <15>       (Default = 15)          Sets the prize-time of Human TimeBomb
  64.  *    amx_dice_drunkardtime <20>        (Default = 20)          Sets the prize-time of Smoking Drunkard
  65.  *    amx_dice_nocliptime <10>          (Default = 10)          Sets the prize-time of Noclip
  66.  *    amx_dice_godmodetime <15>         (Default = 15)          Sets the prize-time of Godmode
  67.  *    amx_dice_zeusmodetime <20>        (Default = 20)          Sets the prize-time of Zeusmode
  68.  *    amx_dice_lukeskywalkertime <20>   (Default = 20)          Sets the prize-time of Luke Skywalker
  69.  *    amx_dice_racecartime <17>         (Default = 17)          Sets the prize-time of Race Car
  70.  *    amx_dice_invisiblegodtime <17>    (Default = 17)          Sets the prize-time of Invisible God
  71.  *    amx_dice_invisibletime <17>       (Default = 17)          Sets the prize-time of Invisible Normal
  72.  *    amx_dice_wildridetime <3>         (Default = 3)           Sets the prize-time of Wild Ride
  73.  *    amx_dice_rambotime <20>           (Default = 20)          Sets the prize-time of Rambo
  74.  *
  75.  *    amx_dice_badprizes <abc..>: (CVAR)        (Default = abcdefghijklm)       Enable all BAD PRIZES you want...      
  76.  *                                                                                      a = Win 100 Chickens
  77.  *                                                                                      b = Nightclub
  78.  *                                                                                      c = Deadly Slap Disease
  79.  *                                                                                      d = Burning
  80.  *                                                                                      e = Wild Ride
  81.  *                                                                                      f = Old Man
  82.  *                                                                                      g = Human Timebomb
  83.  *                                                                                      h = Smoking Drunkard
  84.  *                                                                                      i = Lose XP
  85.  *                                                                                      j = Bankrupt
  86.  *                                                                                      k = Win 50 Crabs (or Monsters)
  87.  *                                                                                      l = Hit by Lightning
  88.  *                                                                                      m = Go Blind
  89.  *
  90.  *    amx_dice_goodprizes <abc..>: (CVAR)       (Default = abcdefghijklm)       Enable all GOOD PRIZES you want...     
  91.  *                                                                                      a = No Clip
  92.  *                                                                                      b = Godmode
  93.  *                                                                                      c = Zeusmode
  94.  *                                                                                      d = Luke Skywalker
  95.  *                                                                                      e = Win Health
  96.  *                                                                                      f = Race Car
  97.  *                                                                                      g = Invisible God
  98.  *                                                                                      h = Invisible Normal
  99.  *                                                                                      i = Win XP
  100.  *                                                                                      j = Win Money
  101.  *                                                                                      k = Full Equipment
  102.  *                                                                                      l = Unlimited Ammo
  103.  *                                                                                      m = Para Action (Rambo)
  104.  *
  105.  *    amx_dice_playmode <1|2|3> (CVAR)          (Default = 1)                   Specify which team(s) are able to roll the dice...
  106.  *                                                                                      1 = ALL
  107.  *                                                                                      2 = Only T
  108.  *                                                                                      3 = Only CT
  109.  *                                                                                     
  110.  *
  111.  *  Client/Admin Commands:
  112.  *
  113.  *    say  roll the dice        (Client)
  114.  *    say  rollthedice          (Client)       
  115.  *    say  roll teh dice        (Client)
  116.  *    say  i feel lucky         (Client)
  117.  *    say  rtd                  (Client)
  118.  *    say  dados                (Client)
  119.  *    say  suerte               (Client)
  120.  *    amx_dice <on|off>         (Admin)
  121.  *
  122.  *
  123.  *  
  124.  *  Changelog:
  125.  *
  126.  *              v2.5 RC 4:
  127.  *                      - fixed lots of runtime errors
  128.  *                      - fixed WIN MONEY message (negative amount)
  129.  *                      - fixed stuck bug in Smoking Drunkard Prize
  130.  *                      - fixed (again) kill message for Rambo and Luke Skywalker - not tested!
  131.  *                      - fixed bug where no timelimit was set for Zeusmode and Godmode
  132.  *                      - fixed bug where a player don't get XP
  133.  *                      - fixed bug where a player still go blind after "GO BLIND" Prize
  134.  *
  135.  *              v2.5 RC 3:
  136.  *                      - fixed a prize bug caused by a typo
  137.  *                      - fixed monstermod support
  138.  *                      - fixed "hit by lightning" message after you lose Health
  139.  *                      - fixed "win money" message
  140.  *                      - fixed WIN 50 CRABS Prize - it should work now
  141.  *                      - fixed runtime- and native error in event_damage function
  142.  *                      - fixed bug where you still go blind after "GO BLIND" Prize - not tested!
  143.  *                      - fixed crash bug
  144.  *                      - fixed lightsaber and Rambo kill message - not tested!
  145.  *                      - added CVAR for Debug Mode
  146.  *                      - added CVAR to specify which team(s) are able roll the dice (idea from 'NS Roll the Dice')
  147.  *                      - added two CVARS to enable/disable the prizes you want
  148.  *                      - added some info textmessages
  149.  *                      - added one say command
  150.  *                      - added good prize: PARA ACTION (RAMBO)
  151.  *                      - rewrote prize system
  152.  *                      - rewrote check_weapon function
  153.  *                      - rewrote event_damage function
  154.  *                      - edited WIN HEALTH Prize - you now get 'additional' 200 Health but max. 255
  155.  *                      - optimized code (not everything)
  156.  *
  157.  *              v2.5 RC 2:
  158.  *                      - added a CVAR to switch between random- and static-times (prizes)
  159.  *                      - added CVARs to set static times
  160.  *                      - added a CVAR for admins which will disable amx_dice_delay for them
  161.  *                      - added good prize: UNLIMITED AMMO
  162.  *                      - added bad prize: LOSE HEALTH (HIT BY LIGHTNING)
  163.  *                      - added bad prize: GO BLIND
  164.  *                      - edited RACE CAR Prize (you now get 150 Health, too)
  165.  *
  166.  *              v2.5 RC 1:
  167.  *                      - plugin renamed to "Advanced Roll The Dice"
  168.  *                      - added good prize: FULL EQUIPMENT
  169.  *                      - added some info textmessages
  170.  *                      - added delay so that you can not roll directly after someone else
  171.  *                      - readded monstmod support (amx_dice_monstermod <1|0>)
  172.  *                      - rewrote some stuff
  173.  *                      - removed tfc support
  174.  *                      - changed CVAR-Name for Dice-Delay
  175.  *                      - edited WON MONEY Prize (you now get 'additional' money)
  176.  *                      - edited 250 HEALTH Prize (you now get 'additional' health)
  177.  *              v2.4f:
  178.  *                      - temporarly removed vault support
  179.  *                      - removed amx_dice_default Admin Command
  180.  *                      - fixed sv_maxspeed bug
  181.  *                      - fixed amx_dice <on | off> bug
  182.  *              v2.4e:         
  183.  *                      - removed monstermod support
  184.  *                      - removed PODBOT support
  185.  *                      - all times of rewards are now RANDOM
  186.  *                      - renamed and relocated INI-File
  187.  *                      - removed/renamed spanish codesnipes (say commands are still there)
  188.  *                      - added require_module
  189.  *                      - modified code
  190.  *                      - fixed (again) some typos
  191.  *              v2.4d:         
  192.  *                      - fixed amx_givexp bug (player don't revive the won xp)
  193.  *              v2.4c:  
  194.  *                      - fixed some bugs (wild ride and native errors)
  195.  *                      - added two rollthedice commands: "roll the dice" and "roll teh dice"
  196.  *              v2.4b:         
  197.  *                      - fixed some mistakes in the grammer and some typos
  198.  *              v2.4a:  
  199.  *                      - Changed 50 Snark Monsters To 50 Headcrabs
  200.  *                      - Added a few translations so as I knew what stuff did
  201.  *                      - Will add a check for monstermod soon, this was just a quick fix to get it working 100% with no errors.                       
  202.  *              v2.4:          
  203.  *                      - Added snark monster prize
  204.  *                      - Check Team for burning
  205.  *                      - WC3 / Superhero Check
  206.  *                      - Some CVARs changed
  207.  *                      - New prizes process (called premios)
  208.  *                      - Added BreadDawson fixes
  209.  *              v2.3:
  210.  *                      - Glowing Removed (it's no funny)
  211.  *                      - Multimod compatibility LOST :( ONLY CS/CZ (sorry)
  212.  *                      - Added this prizes: xp prizes, money prizes, invisibility nogod, burning, nightclub
  213.  *                      - New FX Sounds
  214.  *                      - NoStuck for ZEUSMode & NoClip
  215.  *                      - Rewritten chance code
  216.  *                      - Rewritten prizes code
  217.  *              v2.2:                  
  218.  *                      - fixed invisible bug
  219.  *                      - fixed stuck on bug
  220.  *              v2.1 & before Original by Ludwig van
  221.  *
  222.  *
  223.  *  TO DO:
  224.  *      - voting system
  225.  *      - admin menu
  226.  *      - optimize code (if possible)
  227.  *      - deathmatch mode support
  228.  *      - multimod compatibility (not sure)
  229.  *
  230.  *
  231.  *  CREDITS TO:
  232.  *      - EJL (Original Plugin & Idea)
  233.  *      - BreadDawson & DarkBeatz (for v2.2 & 2.4)
  234.  *      - MattOGM (for v2.4a)
  235.  *      - XxAvalanchexX (for lowspeed when shooting with m249)
  236.  *      - SilverTide (for event_damage function)
  237.  *
  238.  *  THANKS TO:
  239.  *      - v3x
  240.  *      - GHW_Chronic
  241.  *
  242.  ***************************************************************************************/
  243.  
  244. #include <amxmodx>
  245. #include <amxmisc>
  246. #include <engine>
  247. #include <fun>
  248. #include <cstrike>
  249.  
  250. #define PLUGIN  "Advanced Roll The Dice"
  251. #define VERSION "v2.5 RC 4"
  252. #define AUTHOR  "Striker"
  253.  
  254. #define GAMBLING_DELAY_TIME 3.0
  255. #define PARA_SHOOT_SPEED 90.0
  256. #define ADMIN_ACCESS ADMIN_RCON
  257.  
  258. new BOMBKILL_RANGE = 450;  // killing radius of bomb. (96 is playerheight)
  259.  
  260. // Prizes
  261. #define PRIZE_GODMODE           1
  262. #define PRIZE_NOCLIP            2
  263. #define PRIZE_ZEUSMODE          3
  264. #define PRIZE_SLAP              4
  265. #define PRIZE_SPEED             5
  266. #define PRIZE_TIMEBOMB          6
  267. #define PRIZE_INVISIBLE         7
  268. #define PRIZE_NIGHTCLUB         8
  269. #define PRIZE_SLOW              9
  270. #define PRIZE_GRAVITY           10
  271. #define PRIZE_LSABER            11
  272. #define PRIZE_DRINKING          12
  273. #define PRIZE_BLIND             13
  274. #define PRIZE_UNLIMITEDAMMO     14
  275. #define PRIZE_PARA              15
  276.  
  277. // Good or Bad Prize
  278. #define PRIZE_BAD       0
  279. #define PRIZE_GOOD      1
  280.  
  281. // List of all Prizes
  282. #define GOOD_PRIZE_NOCLIP               (1<<0)  // "a"
  283. #define GOOD_PRIZE_GODMODE              (1<<1)  // "b"
  284. #define GOOD_PRIZE_ZEUSMODE             (1<<2)  // "c"
  285. #define GOOD_PRIZE_LUKESKYWALKER        (1<<3)  // "d"
  286. #define GOOD_PRIZE_WINHEALTH            (1<<4)  // "e"
  287. #define GOOD_PRIZE_RACECAR              (1<<5)  // "f"
  288. #define GOOD_PRIZE_INVISIBLEGOD         (1<<6)  // "g"
  289. #define GOOD_PRIZE_INVISIBLE            (1<<7)  // "h"
  290. #define GOOD_PRIZE_WINXP                (1<<8)  // "i"
  291. #define GOOD_PRIZE_WINMONEY             (1<<9)  // "j"
  292. #define GOOD_PRIZE_FULLEQUIPMENT        (1<<10) // "k"
  293. #define GOOD_PRIZE_UNLIMITEDAMMO        (1<<11) // "l"
  294. #define GOOD_PRIZE_PARAACTION           (1<<12) // "m"
  295.  
  296. #define BAD_PRIZE_WINCHICKEN            (1<<0)  // "a"
  297. #define BAD_PRIZE_NIGHTCLUB             (1<<1)  // "b"
  298. #define BAD_PRIZE_SLAP                  (1<<2)  // "c"
  299. #define BAD_PRIZE_BURNING               (1<<3)  // "d"
  300. #define BAD_PRIZE_WILDRIDE              (1<<4)  // "e"
  301. #define BAD_PRIZE_OLDMAN                (1<<5)  // "f"
  302. #define BAD_PRIZE_HUMANTIMEBOMB         (1<<6)  // "g"
  303. #define BAD_PRIZE_SMOKINGDRUNKARD       (1<<7)  // "h"
  304. #define BAD_PRIZE_LOSEXP                (1<<8)  // "i"
  305. #define BAD_PRIZE_BANKRUPT              (1<<9)  // "j"
  306. #define BAD_PRIZE_WINCRABS              (1<<10) // "k"
  307. #define BAD_PRIZE_HITBYLIGHTNING        (1<<11) // "l"
  308. #define BAD_PRIZE_GOBLIND               (1<<12) // "m"
  309.                                                                                
  310.  
  311. new Float:amx_ff;
  312. new Float:LastGambleTime[33];
  313. new Float:oldspeed[33];
  314. new bool:bBombCredit = true;
  315. new bool:bGamesEnabled = true;
  316. new bool:bIsGambling = false;
  317. new bool:rs = false;
  318. new bool:wasFiring[33];
  319. new onfire[33];
  320. new moved[33];
  321. new moves[4][] = {"+moveleft","+moveright","+back","+forward"};
  322. new dcounter[33];
  323. new heart_a[33];
  324. new HasPrize[33][2];
  325. new wasbomb[33];
  326. new origen[3];
  327. new old_svspeed;
  328. new invisiblegod;
  329. new g_lastPosition[33][3];
  330. new g_Hasuammo[33];
  331. new g_ReloadTime[33];
  332. new g_iRoundStart;
  333. new g_msgDamage;
  334. new g_msgFade;
  335. new g_msgShake;
  336. new mdlWcan;
  337. new mdlChicken;
  338. new mdlCrabs;
  339. new mdlWbottle;
  340. new mdlC4bomb;
  341. new mdlGibs;
  342. new sprMflash;
  343. new sprSmoke;
  344. new sprWhite;
  345. new sprFire;
  346. new sprSaber;
  347. new sprFuselight;
  348. new sprFlare6;
  349. new sprBflare;
  350. new sprRflare;
  351. new sprGflare;
  352. new sprTflare;
  353. new sprOflare;
  354. new sprPflare;
  355. new sprYflare;
  356. new sprLightning;
  357.  
  358.  
  359. public plugin_init()
  360. {
  361.         register_plugin(PLUGIN,VERSION,AUTHOR);
  362.         register_concmd("amx_dice", "admin_dice", ADMIN_LEVEL_H, " - <on|off>: Turns dice games on or off.");
  363.         register_clcmd("say", "HandleSay");
  364.         register_cvar("amx_dice_monstermod","0");
  365.         register_cvar("amx_dice_debug","0");
  366.         register_cvar("amx_dice_delay","180.0");
  367.         register_cvar("amx_dice_admin", "0");
  368.         register_cvar("amx_dice_vote", "0" );
  369.         register_cvar("amx_dice_statictimes", "0");
  370.         register_cvar("amx_dice_nightclubtime", "15");
  371.         register_cvar("amx_dice_slaptime", "12");
  372.         register_cvar("amx_dice_oldmantime", "10");
  373.         register_cvar("amx_dice_humanbombtime", "15");
  374.         register_cvar("amx_dice_drunkardtime", "20");
  375.         register_cvar("amx_dice_nocliptime", "10");
  376.         register_cvar("amx_dice_godmodetime", "15");
  377.         register_cvar("amx_dice_zeusmodetime", "20");
  378.         register_cvar("amx_dice_lukeskywalkertime", "20");
  379.         register_cvar("amx_dice_racecartime", "17");
  380.         register_cvar("amx_dice_rambotime", "20");
  381.         register_cvar("amx_dice_invisiblegodtime", "17");
  382.         register_cvar("amx_dice_invisibletime", "17");
  383.         register_cvar("amx_dice_wildridetime", "3");
  384.         register_cvar("amx_dice_badprizes","abcdefghijklm")
  385.         register_cvar("amx_dice_goodprizes","abcdefghijklm")
  386.         register_cvar("amx_dice_playmode","1")
  387.         register_cvar("amx_rollthedice",VERSION,FCVAR_SERVER);
  388.         register_event("SendAudio","roundend_cleanup","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw");
  389.         register_event("TextMsg","roundend_cleanup","a","2&#Game_C","2&#Game_w");
  390.         register_event("RoundTime","round_begin","bc");
  391.         register_event("CurWeapon","check_weapon","be","1=1")
  392.         register_event("ScreenFade","player_screenfade","be","4=255","5=255","6=255","7>199")
  393.         register_event("Damage","event_damage","b","2!0")
  394.         g_msgShake = get_user_msgid("ScreenShake");
  395.         g_msgFade = get_user_msgid("ScreenFade");
  396.         g_msgDamage = get_user_msgid("Damage");
  397.         set_task(1.0,"dice_timer",77,"",0,"b");
  398.        
  399.         return PLUGIN_CONTINUE;
  400. }
  401.  
  402. public plugin_precache()
  403. {
  404.         // Precache 15 Sprites
  405.         sprSmoke = precache_model("sprites/steam1.spr");
  406.         sprWhite = precache_model("sprites/white.spr");
  407.         sprFire = precache_model("sprites/explode1.spr");
  408.         sprSaber = precache_model("sprites/laserbeam.spr");
  409.         sprFuselight = precache_model("sprites/glow01.spr");
  410.         sprMflash = precache_model("sprites/muzzleflash.spr");
  411.         sprFlare6 = precache_model("sprites/Flare6.spr");
  412.         sprBflare = precache_model("sprites/fireworks/bflare.spr");
  413.         sprRflare = precache_model("sprites/fireworks/rflare.spr");
  414.         sprGflare = precache_model("sprites/fireworks/gflare.spr");
  415.         sprTflare = precache_model("sprites/fireworks/tflare.spr");
  416.         sprOflare = precache_model("sprites/fireworks/oflare.spr");
  417.         sprPflare = precache_model("sprites/fireworks/pflare.spr");
  418.         sprYflare = precache_model("sprites/fireworks/yflare.spr");
  419.         sprLightning = precache_model("sprites/lgtning.spr");
  420.        
  421.         // Precache 6 Models
  422.         mdlChicken = precache_model("models/chick.mdl");
  423.         mdlCrabs = precache_model("models/headcrab.mdl");
  424.         mdlC4bomb = precache_model("models/w_weaponbox.mdl");
  425.         mdlGibs = precache_model("models/hgibs.mdl");
  426.         mdlWcan = precache_model("models/can.mdl");
  427.        
  428.         if(file_exists("models/winebottle.mdl")==1)
  429.         {
  430.                 mdlWbottle = precache_model("models/winebottle.mdl");
  431.         }
  432.         else
  433.         {
  434.                 mdlWbottle = precache_model("models/can.mdl");
  435.         }
  436.        
  437.         // Precache 21 Sounds
  438.         precache_sound("ambience/zapmachine.wav");
  439.         precache_sound("ambience/flameburst1.wav");
  440.         precache_sound("ambience/thunder_clap.wav");
  441.         precache_sound("buttons/blip2.wav");
  442.         precache_sound("misc/gemido01.wav");
  443.         precache_sound("misc/gemido02.wav");
  444.         precache_sound("misc/gemido03.wav");
  445.         precache_sound("misc/gemido04.wav");
  446.         precache_sound("misc/chicken4.wav");
  447.         precache_sound("misc/risamalo.wav");
  448.         precache_sound("misc/kotosting.wav");
  449.         precache_sound("misc/stinger12.wav");
  450.         precache_sound("misc/teleport_out_01.wav");
  451.         precache_sound("misc/bipbip.wav");
  452.         precache_sound("misc/blade1.wav");
  453.         precache_sound("misc/applause.wav");
  454.         precache_sound("misc/risa.wav");
  455.         precache_sound("misc/benny1.wav");
  456.         precache_sound("misc/burp.wav");
  457.         precache_sound("vox/_period.wav");
  458.         precache_sound("scientist/scream21.wav");
  459.         precache_sound("scientist/scream07.wav");
  460.        
  461.         return PLUGIN_CONTINUE;
  462. }
  463.  
  464. public round_begin()
  465. {
  466.         if(get_cvar_num("amx_dice_debug") == 2)
  467.                 log_amx("-------- DEBUG (Advanced Roll the Dice): round_begin --------");
  468.        
  469.         if (read_data(1)==floatround(get_cvar_float("mp_roundtime")*60.0))
  470.                 g_iRoundStart=1;
  471.                
  472.         return PLUGIN_CONTINUE;
  473. }
  474.  
  475. public client_connect(id)
  476. {
  477.         client_cmd(id, "echo ");
  478.         client_cmd(id, "echo ^" *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=* ^" ");
  479.         client_cmd(id, "echo ^" *=-= Roll The Dice is active on this Server!  ^" ");
  480.         client_cmd(id, "echo ^" *=-= Type 'rollthedice' to start gambling.    ^" ");
  481.         client_cmd(id, "echo ^" *=-=                                          ^" ");
  482.         client_cmd(id, "echo ^" *=-=          powered by www.fun-arena.com    ^" ");
  483.         client_cmd(id, "echo ^" *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=* ^" ");
  484.         client_cmd(id, "echo ");
  485. }
  486.  
  487. public  client_putinserver(id)
  488. {
  489.         if(is_user_bot(id))
  490.                 return PLUGIN_HANDLED;
  491.                
  492.         LastGambleTime[id] = -1000.0;
  493.         wasbomb[id] = 0;
  494.         g_Hasuammo[id] = 0;
  495.         HasPrize[id][0] = 0;
  496.         HasPrize[id][1] = 0;
  497.         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  498.        
  499.         return PLUGIN_CONTINUE;
  500. }
  501.  
  502. public client_disconnect(id)
  503. {
  504.         if(is_user_bot(id))
  505.                 return PLUGIN_HANDLED;
  506.  
  507.         LastGambleTime[id] = -1000.0;
  508.         wasbomb[id] = 0;
  509.         g_Hasuammo[id] = 0;
  510.         HasPrize[id][0] = 0;
  511.         HasPrize[id][1] = 0;
  512.        
  513.         return PLUGIN_CONTINUE;
  514. }
  515.  
  516. public roundend_cleanup()
  517. {
  518.         if(get_cvar_num("amx_dice_debug") == 2)
  519.                 log_amx("-------- DEBUG (Advanced Roll the Dice): roundend_cleanup --------");
  520.                
  521.         times_up(100);
  522.         rs = true;
  523.         g_iRoundStart=0;
  524.         set_task(15.0,"dice_rs_delay");
  525.        
  526.         new maxplayers = get_maxplayers()+1;
  527.         for(new id = 1; id < maxplayers; id++)
  528.         {
  529.                 if(is_user_connected(id))
  530.                 {
  531.                         g_Hasuammo[id] = 0;
  532.                         HasPrize[id][0] = 0;
  533.                         HasPrize[id][1] = 0;
  534.                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  535.                 }
  536.         }
  537. }
  538.  
  539. public dice_rs_delay()
  540. {
  541.         if(get_cvar_num("amx_dice_debug") == 2)
  542.                 log_amx("DEBUG (Advanced Roll the Dice): Function dice_rs_delay");
  543.  
  544.         rs = false;
  545. }
  546.  
  547. public delay_gambling()
  548. {
  549.         if(get_cvar_num("amx_dice_debug") == 2)
  550.                 log_amx("DEBUG (Advanced Roll the Dice): Function delay_gambling");
  551.        
  552.         bIsGambling = false;
  553. }
  554.  
  555. public round_start()
  556. {
  557.         new maxplayers = get_maxplayers()+1;
  558.         for (new a=1; a<maxplayers; a++)
  559.         {
  560.                 if(wasbomb[a] == 1)
  561.                 {
  562.                         wasbomb[a] = 0;
  563.                 }
  564.                 set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  565.         }
  566.        
  567.         return PLUGIN_CONTINUE;
  568. }
  569.  
  570. playsoundall(ww[])
  571. {
  572.         client_cmd(0,"play %s",ww);
  573. }
  574.  
  575. public admin_dice(id,level,cid)
  576. {
  577.         if (!cmd_access(id,level,cid,1))
  578.         {
  579.                 client_print(id,print_console,"[AMXX] You have no access to that command");
  580.                
  581.                 return PLUGIN_HANDLED;
  582.         }
  583.  
  584.         if (read_argc() < 2)
  585.         {
  586.                 new onoff[4];
  587.                 if(bGamesEnabled == true)
  588.                 {
  589.                         copy(onoff, 4, "ON");
  590.                 }
  591.                 else
  592.                 {
  593.                         copy(onoff, 4, "OFF");
  594.                 }
  595.                 client_print(id,print_console,"[AMXX] Usage: amx_dice < on | off >     Currently: %s", onoff);
  596.                
  597.                 return PLUGIN_HANDLED;
  598.         }
  599.  
  600.         new arg[10];
  601.         read_argv(1,arg,10);
  602.        
  603.         old_svspeed = get_cvar_num("sv_maxspeed");
  604.        
  605.         if ( (equal(arg,"on", 2)) || (equal(arg,"1", 1)) )
  606.         {
  607.                 if ( bGamesEnabled == true )
  608.                 {
  609.                         console_print(id,"[AMXX] Advanced Roll The Dice is already enabled");
  610.                         client_print(id,print_chat, "[AMXX] Advanced Roll The Dice is already enabled");
  611.                 }
  612.                 else
  613.                 {
  614.                         server_cmd("sv_maxspeed 1000");
  615.                         bGamesEnabled = true;
  616.                         set_task(1.0,"dice_timer",77,"",0,"b");
  617.                         console_print(id,"[AMXX] Dice ON");
  618.                         client_print(0,print_chat,"[AMXX] <Dice Dealer>  Admin has turned Roll The Dice mode ON");
  619.                         set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1);
  620.                         show_hudmessage(0,"ADMIN has ENABLED Roll The Dice!^nSay rollthedice to gamble!");
  621.                 }
  622.         }
  623.         else
  624.         {
  625.                 if ( bGamesEnabled == false )
  626.                 {
  627.                         console_print(id,"[AMXX] Advanced Roll the Dice is already disabled");
  628.                         client_print(id,print_chat, "[AMXX] Advanced Roll the Dice is already disabled");
  629.                 }
  630.                 else
  631.                 {
  632.                         bGamesEnabled = false;
  633.                         server_cmd("sv_maxspeed %d",old_svspeed);
  634.                        
  635.                         new maxpl = get_maxplayers() +1;
  636.                        
  637.                         for(new i=1; i > maxpl; i++)
  638.                         {
  639.                                 set_user_maxspeed(i,320.0);
  640.                                 set_user_godmode(i);
  641.                                 set_user_noclip(i);
  642.                                 g_Hasuammo[i] = 0;
  643.                                 HasPrize[i][0] = 0;
  644.                                 HasPrize[i][1] = 0;
  645.                         }
  646.                                
  647.                         remove_task(77);
  648.                         console_print(id,"[AMXX] Dice OFF");
  649.                         client_print(0,print_chat,"[AMXX] <Dice Dealer>  Admin has turned Roll The Dice mode OFF");
  650.                         set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1);
  651.                         show_hudmessage(0,"ADMIN has DISABLED Roll The Dice!");
  652.                 }
  653.         }
  654.        
  655.         new name[32], authid[32];
  656.         get_user_authid(id,authid,31);
  657.         get_user_name(id,name,31);
  658.         log_amx("^"%s<%d>^" (Advanced Roll the Dice) ^"dice_mode <%s>^"", name,get_user_userid(id),arg);
  659.  
  660.         return PLUGIN_HANDLED;
  661. }
  662.  
  663. public HandleSay(id)
  664. {
  665.         new Speech[192];
  666.         read_args(Speech,192);
  667.         remove_quotes(Speech);
  668.        
  669.         if(HandleSay2(id,Speech))      
  670.                 return PLUGIN_HANDLED;
  671.  
  672.         return PLUGIN_CONTINUE;
  673. }
  674.  
  675. public HandleSay2(id,Speech[])
  676. {
  677.         if ( (equali(Speech, "roll the dice")) || (equali(Speech, "i feel lucky")) || (equali(Speech, "suerte")) || (equali(Speech, "dados")) || (equali(Speech, "rollthedice")) || (equali(Speech, "roll teh dice")) || (equali(Speech, "rtd")) )
  678.         {
  679.                 rollthedice(id);
  680.         }
  681.        
  682.         return PLUGIN_CONTINUE;
  683. }
  684.  
  685. public rollthedice(id)
  686. {
  687.         if(is_user_bot(id))
  688.                 return PLUGIN_HANDLED;
  689.                
  690.         else if(bGamesEnabled == false)
  691.         {
  692.                 client_print(id,print_chat, "[AMXX] <Dice Dealer>  Admin has disabled gambling. Bug him to re-enable it.");
  693.                 return PLUGIN_HANDLED;
  694.         }
  695.         else if(is_user_alive(id) == 0)
  696.         {
  697.                 client_print(id,print_chat, "[AMXX] <Dice Dealer>  Dead men roll no dice.");
  698.                 return PLUGIN_HANDLED;
  699.         }
  700.         else if (get_gametime() < LastGambleTime[id] + get_cvar_float("amx_dice_delay"))
  701.         {      
  702.                 if(get_cvar_num("amx_dice_admin") == 0 || !(get_user_flags(id) & ADMIN_ACCESS))
  703.                 {
  704.                         client_print(id,print_chat, "[AMXX] <Dice Dealer>  You gambled recently, try again in %d seconds.",floatround( LastGambleTime[id] + get_cvar_num("amx_dice_delay") - get_gametime()+1 ));
  705.                         return PLUGIN_HANDLED;
  706.                 }
  707.         }
  708.         else if (bIsGambling == true)
  709.         {
  710.                 client_print(id,print_chat, "[AMXX] <Dice Dealer>  I'm busy with someone else, please wait.");
  711.                 return PLUGIN_HANDLED;
  712.         }
  713.         else if (g_iRoundStart == 0)
  714.         {
  715.                 client_print(id,print_chat, "[AMXX] <Dice Dealer>  No Dice before round started.");
  716.                 return PLUGIN_HANDLED;
  717.         }
  718.        
  719.         new team[32];
  720.         get_user_team(id,team,32);
  721.        
  722.         if( (equal(team,"T", 1)) && (get_cvar_num("amx_dice_playmode") == 3) )
  723.         {
  724.                 client_print(id, print_chat, "[AMXX] <Dice Dealer>  Only CTs are allowed to gamble in current play mode.");
  725.                 return PLUGIN_HANDLED;
  726.         }
  727.         else if ( (equal(team,"CT", 1)) && (get_cvar_num("amx_dice_playmode") == 2) )
  728.         {
  729.                 client_print(id, print_chat, "[AMXX] <Dice Dealer>  Only Ts are allowed to gamble in current play mode.");
  730.                 return PLUGIN_HANDLED;
  731.         }
  732.        
  733.         if(get_cvar_num("amx_dice_debug") != 0)
  734.         {
  735.                 new User[32];
  736.                 get_user_name(id,User,32);
  737.                
  738.                 log_amx("DEBUG (Advanced Roll the Dice): rollthedice <%s>", User);
  739.         }
  740.                
  741.         random_prize(id);
  742.        
  743.         return PLUGIN_CONTINUE;
  744. }
  745.  
  746. public random_prize(id)
  747. {
  748.         new Roll = random(2);
  749.         new Roll2 = random(13);
  750.        
  751.         if(get_cvar_num("amx_dice_debug") != 0)
  752.                 log_amx("DEBUG (Advanced Roll the Dice): Function random_prize");
  753.        
  754.         switch(Roll)
  755.         {
  756.                 case 0:
  757.                         {
  758.                                 if(get_cvar_num("amx_dice_debug") != 0)
  759.                                         log_amx("DEBUG (Advanced Roll the Dice): Function random_prize (case 0)");
  760.                                        
  761.                                 bad_prizes(id,Roll2);
  762.                         }
  763.                 case 1:
  764.                         {
  765.                                 if(get_cvar_num("amx_dice_debug") != 0)
  766.                                         log_amx("DEBUG (Advanced Roll the Dice): Function random_prize (case 1)");
  767.                                        
  768.                                 good_prizes(id,Roll2);
  769.                         }
  770.         }
  771.        
  772.         return PLUGIN_CONTINUE;
  773. }
  774.  
  775. public get_prize_flags(type)
  776. {
  777.         new flags[25];
  778.        
  779.         switch(type)
  780.         {
  781.                 case PRIZE_BAD: get_cvar_string("amx_dice_badprizes" , flags , 24);
  782.                 case PRIZE_GOOD: get_cvar_string("amx_dice_goodprizes" , flags , 24);
  783.         }
  784.  
  785.         return read_flags(flags);
  786. }
  787.  
  788. public bad_prizes(id,Roll2)
  789. {
  790.         if(get_cvar_num("amx_dice_debug") != 0)
  791.                 log_amx("DEBUG (Advanced Roll the Dice): Function bad_prizes");
  792.        
  793.         heart_a[id] = 0;
  794.         bIsGambling = true;
  795.         new Red = random(256);
  796.         new Green = random(256);
  797.         new Blue = random(256);
  798.         new User[32];
  799.         get_user_name(id,User,32);
  800.                
  801.         // WIN 100 CHICKENS
  802.         if (Roll2 == 0)
  803.         {
  804.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_WINCHICKEN)
  805.                 {
  806.                         if(get_cvar_num("amx_dice_debug") != 0)
  807.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  808.                        
  809.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s won 100 CHICKENS !!!", User);
  810.                         set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  811.                         show_hudmessage(0,"%s is throwing chickens!!!", User);
  812.                         emit_sound(id,CHAN_ITEM, "misc/chicken4.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  813.                         mod_spawn(id);
  814.                         set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  815.                 }
  816.                 else
  817.                 {
  818.                         bIsGambling = false;
  819.                         Roll2++;
  820.                         bad_prizes(id,Roll2);
  821.                                
  822.                         return PLUGIN_HANDLED;
  823.                 }
  824.         }
  825.         // NIGHTCLUB
  826.         else if (Roll2 == 1)
  827.         {      
  828.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_NIGHTCLUB)
  829.                 {
  830.                         if(get_cvar_num("amx_dice_debug") != 0)
  831.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  832.                        
  833.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s is dancing at the NightClub!", User);
  834.                         HasPrize[id][0] = PRIZE_NIGHTCLUB;
  835.                                        
  836.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  837.                         {
  838.                                 HasPrize[id][1] = random_num(8,14);
  839.                         }
  840.                         else
  841.                         {
  842.                                 HasPrize[id][1] = get_cvar_num("amx_dice_nightclubtime");
  843.                         }
  844.                                        
  845.                         set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  846.                         new tid[2];
  847.                         tid[0] = id;
  848.                         tid[1] = 1;
  849.                         client_cmd(id, "cl_forwardspeed 500");
  850.                         set_task(0.1,"single_knife",0,tid,2,"a",((HasPrize[id][1]+2)*10)-10);
  851.                         emit_sound(id,CHAN_VOICE, "misc/blade1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  852.                 }
  853.                 else
  854.                 {
  855.                         bIsGambling = false;
  856.                         Roll2++;
  857.                         bad_prizes(id,Roll2);
  858.                                                
  859.                         return PLUGIN_HANDLED;
  860.                 }
  861.         }
  862.         // DEADLY SLAP DISEASE
  863.         else if (Roll2 == 2)
  864.         {
  865.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_SLAP)
  866.                 {
  867.                         if(get_cvar_num("amx_dice_debug") != 0)
  868.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  869.                                
  870.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s has contracted the deadly slap disease!", User);
  871.                         HasPrize[id][0] = PRIZE_SLAP;
  872.                                        
  873.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  874.                         {
  875.                                 HasPrize[id][1] = random_num(4,10);
  876.                         }
  877.                         else
  878.                         {
  879.                                 HasPrize[id][1] = get_cvar_num("amx_dice_slaptime");
  880.                         }
  881.                                        
  882.                         user_slap(id,5);
  883.                         set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  884.                 }
  885.                 else
  886.                 {
  887.                         bIsGambling = false;
  888.                         Roll2++;
  889.                         bad_prizes(id,Roll2);
  890.                                                
  891.                         return PLUGIN_HANDLED;
  892.                 }
  893.         }
  894.         // BURNING
  895.         else if (Roll2 == 3)
  896.         {
  897.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_BURNING)
  898.                 {
  899.                         if(get_cvar_num("amx_dice_debug") != 0)
  900.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  901.                                
  902.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s is burning!!!", User);
  903.                         set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  904.                         show_hudmessage(0,"%s will burn until death!",User);
  905.                         new skIndex[2];
  906.                         skIndex[0] = id;
  907.                         new name[32];
  908.                         get_user_name(id,name,31);
  909.                         onfire[id] = 1;
  910.                         ignite_effects(skIndex);
  911.                         ignite_player(skIndex);
  912.                         new tid[1];
  913.                         tid[0] = id;
  914.                         dcounter[id] = 0;
  915.                         set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  916.                 }
  917.                 else
  918.                 {
  919.                         bIsGambling = false;
  920.                         Roll2++;
  921.                         bad_prizes(id,Roll2);
  922.                                                
  923.                         return PLUGIN_HANDLED;
  924.                 }
  925.         }
  926.         // WILD RIDE
  927.         else if (Roll2 == 4)
  928.         {
  929.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_WILDRIDE)
  930.                 {
  931.                         if(get_cvar_num("amx_dice_debug") != 0)
  932.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  933.                                
  934.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s is going for a wild ride!", User);
  935.                         HasPrize[id][0] = PRIZE_GRAVITY;
  936.                                        
  937.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  938.                         {
  939.                                 HasPrize[id][1] = random_num(4,8);
  940.                         }
  941.                         else
  942.                         {
  943.                                 HasPrize[id][1] = get_cvar_num("amx_dice_wildridetime");
  944.                         }
  945.                        
  946.                         set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  947.                         set_user_gravity(id,-50.0);
  948.                         set_user_frags(id,(get_user_frags(id)-1));
  949.                 }
  950.                 else
  951.                 {
  952.                         bIsGambling = false;
  953.                         Roll2++;
  954.                         bad_prizes(id,Roll2);
  955.                                                
  956.                         return PLUGIN_HANDLED;
  957.                 }              
  958.         }
  959.         // OLD MAN
  960.         else if (Roll2 == 5)
  961.         {
  962.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_OLDMAN)
  963.                 {
  964.                         if(get_cvar_num("amx_dice_debug") != 0)
  965.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  966.                                
  967.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  Oh no, %s is an old man now.", User);
  968.                         HasPrize[id][0] = PRIZE_SLOW;
  969.                                        
  970.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  971.                         {
  972.                                 HasPrize[id][1] = random_num(8,15);
  973.                         }
  974.                         else
  975.                         {
  976.                                 HasPrize[id][1] = get_cvar_num("amx_dice_oldmantime");
  977.                         }
  978.                                                
  979.                         oldspeed[id] = get_user_maxspeed(id);
  980.                         emit_sound(id,CHAN_VOICE, "misc/benny1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  981.                         set_user_maxspeed(id,72.0);
  982.                         set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  983.                 }
  984.                 else
  985.                 {
  986.                         bIsGambling = false;
  987.                         Roll2++;
  988.                         bad_prizes(id,Roll2);
  989.                                                
  990.                         return PLUGIN_HANDLED;
  991.                 }
  992.         }
  993.         // HUMAN TIMEBOMB
  994.         else if (Roll2 == 6)
  995.         {
  996.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_HUMANTIMEBOMB)
  997.                 {
  998.                         if(get_cvar_num("amx_dice_debug") != 0)
  999.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  1000.                                
  1001.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s is now a human time-bomb!  Everyone RUN for cover", User);
  1002.                         HasPrize[id][0] = PRIZE_TIMEBOMB;
  1003.                        
  1004.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  1005.                         {
  1006.                                 HasPrize[id][1] = random_num(10,18);
  1007.                         }
  1008.                         else
  1009.                         {
  1010.                                 HasPrize[id][1] = get_cvar_num("amx_dice_humanbombtime");
  1011.                         }
  1012.                        
  1013.                         client_cmd(0, "spk ^"warning _comma detonation device activated^"");
  1014.                         player_attachment(id);
  1015.                 }
  1016.                 else
  1017.                 {
  1018.                         bIsGambling = false;
  1019.                         Roll2++;
  1020.                         bad_prizes(id,Roll2);
  1021.                                                
  1022.                         return PLUGIN_HANDLED;
  1023.                 }
  1024.         }
  1025.         // SMOKING DRUNKARD
  1026.         else if (Roll2 == 7)
  1027.         {
  1028.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_SMOKINGDRUNKARD)
  1029.                 {
  1030.                         if(get_cvar_num("amx_dice_debug") != 0)
  1031.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  1032.                                
  1033.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s is now a smoking drunkard!", User);
  1034.                         HasPrize[id][0] = PRIZE_DRINKING;
  1035.                                        
  1036.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  1037.                         {
  1038.                                 HasPrize[id][1] = random_num(10,25);
  1039.                         }
  1040.                         else
  1041.                         {
  1042.                                 HasPrize[id][1] = get_cvar_num("amx_dice_drunkardtime");
  1043.                         }
  1044.                        
  1045.                         new tid[1];
  1046.                         tid[0] = id;
  1047.                         dcounter[id] = 0;
  1048.                         set_task(0.5,"smokin_1",0,tid,1,"a",HasPrize[id][1]*2);
  1049.                         set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1050.                 }
  1051.                 else
  1052.                 {
  1053.                         bIsGambling = false;
  1054.                         Roll2++;
  1055.                         bad_prizes(id,Roll2);
  1056.                                                
  1057.                         return PLUGIN_HANDLED;
  1058.                 }
  1059.         }
  1060.         // LOST XP
  1061.         else if (Roll2 == 8)
  1062.         {
  1063.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_LOSEXP)
  1064.                 {
  1065.                         if(get_cvar_num("amx_dice_debug") != 0)
  1066.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  1067.                                
  1068.                         new war3xp = get_cvar_num("Warcraft_3_XP");
  1069.                         new war3ft = get_cvar_num("sv_warcraft3");
  1070.                         new shero = get_cvar_num("sv_superheros");             
  1071.                
  1072.                         if (war3ft == 1)
  1073.                         {
  1074.                                 new cantidadxp = (random(3)+1)*100;
  1075.                                 client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s lost %d xp",User,cantidadxp);
  1076.                                 server_cmd("amx_givexp ^"%s^" -%d",User,cantidadxp);
  1077.                                 set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1078.                                 show_hudmessage(0,"Oooh! %s lost %d XP!",User,cantidadxp);
  1079.                                 client_cmd(0,"spk misc/risa.wav");
  1080.                                 set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1081.                         }
  1082.                         else if(war3xp == 1)
  1083.                         {
  1084.                                 new cantidadxp = (random(3)+1)*100;
  1085.                                 client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s lost %d xp",User,cantidadxp);
  1086.                                 server_cmd("wc3_givexp ^"%s^" -%d",User,cantidadxp);
  1087.                                 set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1088.                                 show_hudmessage(0,"Oooh! %s lost %d XP!",User,cantidadxp);
  1089.                                 client_cmd(0,"spk misc/risa.wav");
  1090.                                 set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1091.                         }
  1092.                         else if (shero == 1)
  1093.                         {
  1094.                                 new cantidadxp = (random(3)+1)*100;
  1095.                                 client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s lost %d xp",User,cantidadxp);
  1096.                                 server_cmd("amx_shaddxp ^"%s^" -%d",User,cantidadxp);
  1097.                                 set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1098.                                 show_hudmessage(0,"Oooh! %s lost %d XP!",User,cantidadxp);
  1099.                                 client_cmd(0,"spk misc/risa.wav");
  1100.                                 set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1101.                         }
  1102.                         else if (shero == 0 && war3xp == 0 && war3ft == 0)
  1103.                         {
  1104.                                 client_print(0,print_chat, "[AMXX] <Dice Dealer>  SuperHero/War3xp Not Running, Re-Rolling");
  1105.                                 set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1106.                                 show_hudmessage(0,"SuperHero/War3xp Not Running, Re-Rolling");
  1107.                                 bIsGambling = false;
  1108.                                 Roll2++;
  1109.                                 bad_prizes(id,Roll2);
  1110.                                                
  1111.                                 return PLUGIN_HANDLED;
  1112.                         }
  1113.                 }
  1114.                 else
  1115.                 {
  1116.                         bIsGambling = false;
  1117.                         Roll2++;
  1118.                         bad_prizes(id,Roll2);
  1119.                                                
  1120.                         return PLUGIN_HANDLED;
  1121.                 }
  1122.         }
  1123.         // BANKRUPT
  1124.         else if (Roll2 == 9)
  1125.         {
  1126.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_BANKRUPT)
  1127.                 {
  1128.                         if(get_cvar_num("amx_dice_debug") != 0)
  1129.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  1130.                                
  1131.                         cs_set_user_money(id,0);
  1132.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s is bankrupt",User);
  1133.                         set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1134.                         show_hudmessage(0,"Sorry %s, you lost all your money!",User);
  1135.                         client_cmd(0,"spk misc/risa.wav");
  1136.                         set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1137.                 }
  1138.                 else
  1139.                 {
  1140.                         bIsGambling = false;
  1141.                         Roll2++;
  1142.                         bad_prizes(id,Roll2);
  1143.                                                
  1144.                         return PLUGIN_HANDLED;
  1145.                 }
  1146.         }
  1147.         // WIN 50 CRABS
  1148.         else if (Roll2 == 10)
  1149.         {
  1150.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_WINCRABS)
  1151.                 {
  1152.                         if(get_cvar_num("amx_dice_debug") != 0)
  1153.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  1154.                                
  1155.                         if(get_cvar_num("amx_dice_monstermod") == 1)
  1156.                         {
  1157.                                 client_cmd(0,"spk headcrab/hc_alert1.wav");
  1158.                                 client_print(0,print_chat, "[AMXX] <Dice Dealer>  OMG! %s is throwing 50 little monsters!!", User);
  1159.                                 set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1160.                                 show_hudmessage(0,"%s is throwing 50 little monsters!!", User);
  1161.                         }
  1162.                         else
  1163.                         {
  1164.                                 client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s won 50 CRABS !!!", User);
  1165.                                 set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1166.                                 show_hudmessage(0,"%s is throwing crabs!!!", User);
  1167.                         }
  1168.                                        
  1169.                         mod_spawn2(id);
  1170.                         set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1171.                 }
  1172.                 else
  1173.                 {
  1174.                         bIsGambling = false;
  1175.                         Roll2++;
  1176.                         bad_prizes(id,Roll2);
  1177.                                                
  1178.                         return PLUGIN_HANDLED;
  1179.                 }
  1180.         }
  1181.         // LOSE HEALTH (HIT BY LIGHTNING)
  1182.         else if (Roll2 == 11)
  1183.         {
  1184.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_HITBYLIGHTNING)
  1185.                 {
  1186.                         if(get_cvar_num("amx_dice_debug") != 0)
  1187.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  1188.                                
  1189.                         new health = get_user_health(id);
  1190.                         new health_new = health - 60;
  1191.                         set_user_health(id,health_new);
  1192.                         new origin[3];
  1193.                         get_user_origin(id,origin);
  1194.                         origin[2] = origin[2] - 26;
  1195.                         new sorigin[3];
  1196.                         sorigin[0] = origin[0] + 150;
  1197.                         sorigin[1] = origin[1] + 150;
  1198.                         sorigin[2] = origin[2] + 400;
  1199.                         lightning(sorigin,origin);
  1200.                         emit_sound(id,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  1201.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s was hit by lightning!", User);
  1202.                         set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1203.                                        
  1204.                         if (health_new > 0)
  1205.                                 show_hudmessage(0, "%s was hit by lightning.",User);
  1206.                         else if (health_new <= 0)
  1207.                                 show_hudmessage(0, "%s was hit by lightning and died.",User);
  1208.                
  1209.                         set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1210.                 }
  1211.                 else
  1212.                 {
  1213.                         bIsGambling = false;
  1214.                         Roll2++;
  1215.                         bad_prizes(id,Roll2);
  1216.                                                
  1217.                         return PLUGIN_HANDLED;
  1218.                 }
  1219.         }
  1220.         // GO BLIND
  1221.         else if (Roll2 == 12)
  1222.         {
  1223.                 if (get_prize_flags(PRIZE_BAD)&BAD_PRIZE_GOBLIND)
  1224.                 {
  1225.                         if(get_cvar_num("amx_dice_debug") != 0)
  1226.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[0], Roll2=[%d] <%s>",Roll2, User);
  1227.                                
  1228.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s is blind!",User);
  1229.                         set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1230.                         show_hudmessage(0,"%s is now blind.",User);
  1231.                         HasPrize[id][0] = PRIZE_BLIND;
  1232.                         player_blind(id);
  1233.                         set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1234.                 }
  1235.                 else
  1236.                 {
  1237.                         bIsGambling = false;
  1238.                         random_prize(id);
  1239.                                                
  1240.                         return PLUGIN_HANDLED;
  1241.                 }
  1242.                
  1243.         }
  1244.        
  1245.         client_print(id,print_chat, "[AMXX] <Dice Dealer>  You rolled [1] [%d]", Roll2+1);
  1246.        
  1247.         LastGambleTime[id] = get_gametime();
  1248.        
  1249.         return PLUGIN_CONTINUE;
  1250. }
  1251.  
  1252. public good_prizes(id,Roll2)
  1253. {
  1254.         if(get_cvar_num("amx_dice_debug") != 0)
  1255.                 log_amx("DEBUG (Advanced Roll the Dice): Function good_prizes");
  1256.        
  1257.         heart_a[id] = 0;
  1258.         bIsGambling = true;
  1259.         new Red = random(256);
  1260.         new Green = random(256);
  1261.         new Blue = random(256);
  1262.         new User[32];
  1263.         get_user_name(id,User,32);
  1264.                
  1265.         // NO CLIP
  1266.         if (Roll2 == 0)
  1267.         {
  1268.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_NOCLIP)
  1269.                 {
  1270.                         if(get_cvar_num("amx_dice_debug") != 0)
  1271.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1272.                                
  1273.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  Congratulations, %s won Noclip!", User);
  1274.                         HasPrize[id][0] = PRIZE_NOCLIP;
  1275.                        
  1276.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  1277.                         {
  1278.                                 HasPrize[id][1] = random_num(8,14);
  1279.                         }
  1280.                         else
  1281.                         {
  1282.                                 HasPrize[id][1] = get_cvar_num("amx_dice_nocliptime");
  1283.                         }
  1284.                        
  1285.                         set_user_noclip(id,1);
  1286.                         set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1287.                         emit_sound(id,CHAN_ITEM, "misc/kotosting.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  1288.                 }
  1289.                 else
  1290.                 {
  1291.                         bIsGambling = false;
  1292.                         Roll2++;
  1293.                         good_prizes(id,Roll2);
  1294.                                
  1295.                         return PLUGIN_HANDLED;
  1296.                 }
  1297.         }
  1298.         // GODMODE
  1299.         else if (Roll2 == 1)
  1300.         {
  1301.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_GODMODE)
  1302.                 {
  1303.                         if(get_cvar_num("amx_dice_debug") != 0)
  1304.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1305.                                
  1306.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  Congratulations, %s won Godmode!", User);
  1307.                         HasPrize[id][0] = PRIZE_GODMODE;
  1308.                
  1309.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  1310.                         {
  1311.                                 HasPrize[id][1] = random_num(10,16);
  1312.                         }
  1313.                         else
  1314.                         {
  1315.                                 HasPrize[id][1] = get_cvar_num("amx_dice_godmodetime");
  1316.                         }
  1317.                        
  1318.                         set_user_godmode(id,1);
  1319.                         set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1320.                         emit_sound(id,CHAN_ITEM, "misc/stinger12.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  1321.                 }
  1322.                 else
  1323.                 {
  1324.                         bIsGambling = false;
  1325.                         Roll2++;
  1326.                         good_prizes(id,Roll2);
  1327.                                
  1328.                         return PLUGIN_HANDLED;
  1329.                 }
  1330.         }
  1331.         // ZEUSMODE
  1332.         else if (Roll2 == 2)
  1333.         {
  1334.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_ZEUSMODE)
  1335.                 {
  1336.                         if(get_cvar_num("amx_dice_debug") != 0)
  1337.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1338.                                
  1339.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  Whoa, %s won ZeusMode!!", User);
  1340.                         HasPrize[id][0] = PRIZE_ZEUSMODE;
  1341.                        
  1342.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  1343.                         {
  1344.                                 HasPrize[id][1] = random_num(10,20);
  1345.                         }
  1346.                         else
  1347.                         {
  1348.                                 HasPrize[id][1] = get_cvar_num("amx_dice_zeusmodetime");
  1349.                         }
  1350.                        
  1351.                         set_user_godmode(id,1);
  1352.                         set_user_noclip(id,1);
  1353.                         client_cmd(id, "cl_forwardspeed 700");
  1354.                         oldspeed[id] = get_user_maxspeed(id);
  1355.                         get_user_origin(id, origen, 0);
  1356.                         set_user_maxspeed(id,700.0);
  1357.                         set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1358.                         emit_sound(id,CHAN_ITEM, "misc/risamalo.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  1359.                 }
  1360.                 else
  1361.                 {
  1362.                         bIsGambling = false;
  1363.                         Roll2++;
  1364.                         good_prizes(id,Roll2);
  1365.                        
  1366.                         return PLUGIN_HANDLED;
  1367.                 }
  1368.         }
  1369.         // LUKE SKYWALKER
  1370.         else if (Roll2 == 3)
  1371.         {
  1372.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_LUKESKYWALKER)
  1373.                 {
  1374.                         if(get_cvar_num("amx_dice_debug") != 0)
  1375.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1376.                        
  1377.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  Caution! %s is now Luke Skywalker!!!", User);
  1378.                         HasPrize[id][0] = PRIZE_LSABER;
  1379.                        
  1380.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  1381.                         {
  1382.                                 HasPrize[id][1] = random_num(10,20);
  1383.                         }
  1384.                         else
  1385.                         {
  1386.                                 HasPrize[id][1] = get_cvar_num("amx_dice_lukeskywalkertime");
  1387.                         }
  1388.                        
  1389.                         new tid[2];
  1390.                         tid[0] = id;
  1391.                         set_user_godmode(id,1);
  1392.                         tid[1] = 1;
  1393.                         set_task(0.1,"lightsaber",0,tid,2,"a",(HasPrize[id][1]*10)-10);
  1394.                         emit_sound(id,CHAN_ITEM, "ambience/zapmachine.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  1395.                 }
  1396.                 else
  1397.                 {
  1398.                         bIsGambling = false;
  1399.                         Roll2++;
  1400.                         good_prizes(id,Roll2);
  1401.                                
  1402.                         return PLUGIN_HANDLED;
  1403.                 }
  1404.         }
  1405.         // WIN HEALTH
  1406.         else if (Roll2 == 4)
  1407.         {
  1408.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_WINHEALTH)
  1409.                 {
  1410.                         if(get_cvar_num("amx_dice_debug") != 0)
  1411.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1412.                                
  1413.                         new current_health = get_user_health(id);
  1414.                         new new_health = current_health+200;
  1415.                        
  1416.                         if (new_health > 255)
  1417.                                 set_user_health(id,255);
  1418.                         else
  1419.                                 set_user_health(id,new_health);
  1420.                                
  1421.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s won and now has %d health!!!", User, get_user_health(id));
  1422.                         client_cmd(0, "spk ^"fvox/beep _comma beep _comma beep _comma administering_medical^"");
  1423.                         set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1424.                         show_hudmessage(0,"%s won and now has %d health.",User, get_user_health(id));
  1425.                         set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1426.                 }
  1427.                 else
  1428.                 {
  1429.                         bIsGambling = false;
  1430.                         Roll2++;
  1431.                         good_prizes(id,Roll2);
  1432.                                
  1433.                         return PLUGIN_HANDLED;
  1434.                 }
  1435.         }
  1436.         // RACE CAR
  1437.         else if (Roll2 == 5)
  1438.         {
  1439.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_RACECAR)
  1440.                 {
  1441.                         if(get_cvar_num("amx_dice_debug") != 0)
  1442.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1443.                                
  1444.                         set_user_health(id,150);
  1445.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s has won race car mode!", User);
  1446.                         HasPrize[id][0] = PRIZE_SPEED;
  1447.                        
  1448.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  1449.                         {
  1450.                                 HasPrize[id][1] = random_num(12,18);
  1451.                         }
  1452.                         else
  1453.                         {
  1454.                                 HasPrize[id][1] = get_cvar_num("amx_dice_racecartime");
  1455.                         }
  1456.                                
  1457.                         client_cmd(id, "cl_forwardspeed 1000");
  1458.                         oldspeed[id] = get_user_maxspeed(id);
  1459.                         emit_sound(id,CHAN_ITEM, "misc/bipbip.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  1460.                         set_user_maxspeed(id,1000.0);
  1461.                         set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1462.                 }
  1463.                 else
  1464.                 {
  1465.                         bIsGambling = false;
  1466.                         Roll2++;
  1467.                         good_prizes(id,Roll2);
  1468.                                
  1469.                         return PLUGIN_HANDLED;
  1470.                 }
  1471.         }
  1472.         // INVISIBLE GOD
  1473.         else if (Roll2 == 6)
  1474.         {
  1475.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_INVISIBLEGOD)
  1476.                 {
  1477.                         if(get_cvar_num("amx_dice_debug") != 0)
  1478.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1479.                        
  1480.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s is the invisible GOD now!", User);
  1481.                         HasPrize[id][0] = PRIZE_INVISIBLE;
  1482.                        
  1483.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  1484.                         {
  1485.                                 HasPrize[id][1] = random_num(12,18);
  1486.                         }
  1487.                         else
  1488.                         {
  1489.                                 HasPrize[id][1] = get_cvar_num("amx_dice_invisiblegodtime");
  1490.                         }
  1491.                        
  1492.                         invisiblegod = 1;
  1493.                         client_cmd(id, "cl_forwardspeed 500");
  1494.                         emit_sound(id,CHAN_ITEM, "misc/teleport_out_01.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  1495.                         oldspeed[id] = get_user_maxspeed(id);
  1496.                         set_user_maxspeed(id,500.0);
  1497.                         set_user_godmode(id,1);
  1498.                         set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransAdd,5);
  1499.                         new tid[2];
  1500.                         tid[0] = id;
  1501.                         tid[1] = 1;
  1502.                         set_task(0.05,"invisibility",0,tid,2,"a",(HasPrize[id][1]*10)-10);
  1503.                 }
  1504.                 else
  1505.                 {
  1506.                         bIsGambling = false;
  1507.                         Roll2++;
  1508.                         good_prizes(id,Roll2);
  1509.                                
  1510.                         return PLUGIN_HANDLED;
  1511.                 }
  1512.         }
  1513.         // INVISIBLE NORMAL
  1514.         else if (Roll2 == 7)
  1515.         {
  1516.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_INVISIBLE)
  1517.                 {
  1518.                         if(get_cvar_num("amx_dice_debug") != 0)
  1519.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1520.                        
  1521.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s is the invisible man now!", User);
  1522.                         invisiblegod = 0;
  1523.                         HasPrize[id][0] = PRIZE_INVISIBLE;
  1524.                        
  1525.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  1526.                         {
  1527.                                 HasPrize[id][1] = random_num(12,18);
  1528.                         }
  1529.                         else
  1530.                         {
  1531.                                 HasPrize[id][1] = get_cvar_num("amx_dice_invisibletime");
  1532.                         }
  1533.                        
  1534.                         client_cmd(id, "cl_forwardspeed 500");
  1535.                         emit_sound(id,CHAN_ITEM, "misc/teleport_out_01.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  1536.                         oldspeed[id] = get_user_maxspeed(id);
  1537.                         set_user_maxspeed(id,500.0);
  1538.                         set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransAdd,5);
  1539.                         new tid[2];
  1540.                         tid[0] = id;
  1541.                         tid[1] = 1;
  1542.                         set_task(0.05,"invisibility",0,tid,2,"a",(HasPrize[id][1]*10)-10);
  1543.                 }
  1544.                 else
  1545.                 {
  1546.                         bIsGambling = false;
  1547.                         Roll2++;
  1548.                         good_prizes(id,Roll2);
  1549.                                
  1550.                         return PLUGIN_HANDLED;
  1551.                 }
  1552.         }
  1553.         // WIN XP
  1554.         else if (Roll2 == 8)
  1555.         {
  1556.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_WINXP)
  1557.                 {
  1558.                         if(get_cvar_num("amx_dice_debug") != 0)
  1559.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1560.                                
  1561.                         new war3xp = get_cvar_num("Warcraft_3_XP");
  1562.                         new war3ft = get_cvar_num("sv_warcraft3");
  1563.                         new shero = get_cvar_num("sv_superheros");
  1564.                        
  1565.                         if (war3ft == 1)
  1566.                         {
  1567.                                 new cantidadxp = (random(13)+1)*100;
  1568.                                 client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s won %d xp",User,cantidadxp);
  1569.                                 server_cmd("amx_givexp ^"%s^" %d",User,cantidadxp);
  1570.                                 set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1571.                                 show_hudmessage(0,"Congratulations %s, you win %d XP!",User,cantidadxp);
  1572.                                 client_cmd(0,"spk misc/applause.wav");
  1573.                                 set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1574.                         }
  1575.                         else if(war3xp == 1)
  1576.                         {
  1577.                                 new cantidadxp = (random(13)+1)*100;
  1578.                                 client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s won %d xp",User,cantidadxp);
  1579.                                 server_cmd("wc3_givexp ^"%s^" %d",User,cantidadxp);
  1580.                                 set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1581.                                 show_hudmessage(0,"Congratulations %s, you win %d XP!",User,cantidadxp);
  1582.                                 client_cmd(0,"spk misc/applause.wav");
  1583.                                 set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1584.                         }
  1585.                         else if (shero == 1)
  1586.                         {
  1587.                                 new cantidadxp = (random(13)+1)*100;
  1588.                                 client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s won %d xp",User,cantidadxp);
  1589.                                 server_cmd("amx_shaddxp ^"%s^" %d",User,cantidadxp);
  1590.                                 set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1591.                                 show_hudmessage(0,"Congratulations %s, you win %d XP!",User,cantidadxp);
  1592.                                 client_cmd(0,"spk misc/applause.wav");
  1593.                                 set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1594.                         }
  1595.                         else if (shero == 0 && war3xp == 0 && war3ft == 0)
  1596.                         {
  1597.                                 client_print(0,print_chat, "[AMXX] <Dice Dealer>  SuperHero/Wr3xp Not Running, Re-Rolling");
  1598.                                 set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1599.                                 show_hudmessage(0,"SuperHero/War3xp Not Running, Re-Rolling");
  1600.                                 bIsGambling = false;
  1601.                                 Roll2++;
  1602.                                 good_prizes(id,Roll2);
  1603.                                
  1604.                                 return PLUGIN_HANDLED;
  1605.                         }
  1606.                 }
  1607.                 else
  1608.                 {
  1609.                         bIsGambling = false;
  1610.                         Roll2++;
  1611.                         good_prizes(id,Roll2);
  1612.                                
  1613.                         return PLUGIN_HANDLED;
  1614.                 }
  1615.         }
  1616.         // WIN MONEY
  1617.         else if (Roll2 == 9)
  1618.         {
  1619.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_WINMONEY)
  1620.                 {
  1621.                         if(get_cvar_num("amx_dice_debug") != 0)
  1622.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1623.                                
  1624.                         new money = cs_get_user_money(id)
  1625.                         new money_new = money*random(3)+1;
  1626.                         cs_set_user_money(id,money_new)
  1627.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s won and now has $%d",User, money_new);
  1628.                         set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1629.                         show_hudmessage(0,"Congratulations %s, you won $%d!",User, money_new);
  1630.                         client_cmd(0,"spk misc/applause.wav");
  1631.                         set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1632.                 }
  1633.                 else
  1634.                 {
  1635.                         bIsGambling = false;
  1636.                         Roll2++;
  1637.                         good_prizes(id,Roll2);
  1638.                                
  1639.                         return PLUGIN_HANDLED;
  1640.                 }
  1641.         }
  1642.         // FULL EQUIPMENT
  1643.         else if (Roll2 == 10)
  1644.         {
  1645.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_FULLEQUIPMENT)
  1646.                 {
  1647.                         if(get_cvar_num("amx_dice_debug") != 0)
  1648.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1649.                                
  1650.                         new team[32];
  1651.                         get_user_team(id,team,32);
  1652.                         strip_user_weapons(id);
  1653.                        
  1654.                         if(equal(team,"T", 1))
  1655.                         {
  1656.                                 give_item(id,"weapon_glock18");
  1657.                                 give_item(id,"ammo_9mm");
  1658.                                 give_item(id,"ammo_9mm");
  1659.                                 give_item(id,"ammo_9mm");
  1660.                                 give_item(id,"ammo_9mm");
  1661.                                 give_item(id,"weapon_ak47");
  1662.                                 give_item(id,"ammo_762nato");
  1663.                                 give_item(id,"ammo_762nato");
  1664.                                 give_item(id,"ammo_762nato");
  1665.                                 give_item(id,"ammo_762nato");
  1666.                         }
  1667.                         else
  1668.                         {
  1669.                                 give_item(id,"weapon_usp");
  1670.                                 give_item(id,"ammo_45acp");
  1671.                                 give_item(id,"ammo_45acp");
  1672.                                 give_item(id,"ammo_45acp");
  1673.                                 give_item(id,"ammo_45acp");
  1674.                                 give_item(id,"weapon_m4a1");
  1675.                                 give_item(id,"ammo_556nato");
  1676.                                 give_item(id,"ammo_556nato");
  1677.                                 give_item(id,"ammo_556nato");
  1678.                                 give_item(id,"ammo_556nato");
  1679.                         }
  1680.                        
  1681.                         give_item(id,"weapon_knife");
  1682.                         give_item(id,"weapon_smokegrenade");
  1683.                         give_item(id,"weapon_flashbang");
  1684.                         give_item(id,"weapon_flashbang");
  1685.                         give_item(id,"weapon_hegrenade");
  1686.                         give_item(id,"item_thighpack");
  1687.                         give_item(id,"item_assaultsuit");
  1688.                         give_item(id,"item_kevlar");
  1689.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s got FULL EQUIPMENT!",User);
  1690.                         set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1691.                         show_hudmessage(0,"%s got FULL EQUIPMENT.",User);
  1692.                         client_cmd(0, "spk ^"fvox/weapon_pickup^"");
  1693.                         set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1694.                 }
  1695.                 else
  1696.                 {
  1697.                         bIsGambling = false;
  1698.                         Roll2++;
  1699.                         good_prizes(id,Roll2);
  1700.                                
  1701.                         return PLUGIN_HANDLED;
  1702.                 }
  1703.         }
  1704.         // UNLIMITED AMMO
  1705.         else if (Roll2 == 11)
  1706.         {
  1707.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_UNLIMITEDAMMO)
  1708.                 {
  1709.                         if(get_cvar_num("amx_dice_debug") != 0)
  1710.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1711.                                
  1712.                         g_Hasuammo[id] = 1;
  1713.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s has unlimited ammo!",User);
  1714.                         set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1715.                         set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 1);
  1716.                         show_hudmessage(0,"Warning! %s has unlimited ammo.",User);
  1717.                         client_cmd(0, "spk ^"alert _period got _comma ammunition _period _period run _comma over^"");
  1718.                         set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  1719.                 }
  1720.                 else
  1721.                 {
  1722.                         bIsGambling = false;
  1723.                         Roll2++;
  1724.                         good_prizes(id,Roll2);
  1725.                                
  1726.                         return PLUGIN_HANDLED;
  1727.                 }
  1728.         }
  1729.         // PARA ACTION (RAMBO)
  1730.         else if (Roll2 == 12)
  1731.         {
  1732.                 if (get_prize_flags(PRIZE_GOOD)&GOOD_PRIZE_PARAACTION)
  1733.                 {
  1734.                         if(get_cvar_num("amx_dice_debug") != 0)
  1735.                                 log_amx("DEBUG (Advanced Roll the Dice): Roll=[1], Roll2=[%d] <%s>",Roll2, User);
  1736.  
  1737.                         strip_user_weapons(id);
  1738.                         give_item(id,"weapon_m249");
  1739.                         give_item(id,"ammo_556natobox");
  1740.                         give_item(id,"ammo_556natobox");
  1741.                         give_item(id,"ammo_556natobox");
  1742.                         give_item(id,"ammo_556natobox");
  1743.                         g_Hasuammo[id] = 1;
  1744.  
  1745.                         set_user_rendering(id,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1746.                         client_print(0,print_chat, "[AMXX] <Dice Dealer>  %s got a PARA!", User);
  1747.                         HasPrize[id][0] = PRIZE_PARA;
  1748.                                
  1749.                         if( get_cvar_num("amx_dice_statictimes") == 0)
  1750.                         {
  1751.                                 HasPrize[id][1] = random_num(15,25);
  1752.                         }
  1753.                         else
  1754.                         {
  1755.                                 HasPrize[id][1] = get_cvar_num("amx_dice_rambotime");
  1756.                         }
  1757.                                
  1758.                         oldspeed[id] = get_user_maxspeed(id);
  1759.                         client_cmd(0,"spk x/x_pain2.wav");
  1760.                 }
  1761.                 else
  1762.                 {
  1763.                         bIsGambling = false;
  1764.                         random_prize(id);
  1765.  
  1766.                         return PLUGIN_HANDLED;
  1767.                 }
  1768.         }
  1769.        
  1770.         client_print(id,print_chat, "[AMXX] <Dice Dealer>  You rolled [2] [%d]", Roll2+1);
  1771.        
  1772.         LastGambleTime[id] = get_gametime();
  1773.        
  1774.         return PLUGIN_CONTINUE;
  1775. }
  1776.  
  1777. public dice_timer()
  1778. {
  1779.         if(get_cvar_num("amx_dice_debug") == 2)
  1780.                 log_amx("DEBUG (Advanced Roll the Dice): Function dice_timer");
  1781.        
  1782.         if(bIsGambling == false)
  1783.                 return PLUGIN_CONTINUE;
  1784.  
  1785.         new Red = random(256);
  1786.         new Green = random(256);
  1787.         new Blue = random(256);
  1788.         new Float:gt = get_gametime();
  1789.         new maxpl = get_maxplayers() +1;
  1790.         new a;
  1791.        
  1792.         for(a=1; a < maxpl; a++)
  1793.         {
  1794.                 if ( (HasPrize[a][0] > 0) && ((LastGambleTime[a] + 60) < gt) )
  1795.                 {                      
  1796.                         HasPrize[a][0] = 0;
  1797.                         HasPrize[a][1] = 0;
  1798.                         bIsGambling = false;
  1799.                 }
  1800.         }
  1801.        
  1802.         for(a=1; a < maxpl; a++)
  1803.         {
  1804.                 if (HasPrize[a][0] > 0)
  1805.                 {
  1806.                         if(HasPrize[a][0] == PRIZE_TIMEBOMB)
  1807.                         {
  1808.                                 emit_sound(a,CHAN_ITEM, "buttons/blip2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  1809.                                 new origin[3];
  1810.                                 get_user_origin(a,origin);
  1811.  
  1812.                                 // TE_SPRITE   
  1813.                                 message_begin(MSG_BROADCAST,SVC_TEMPENTITY,{0,0,0},a);
  1814.                                 write_byte(17);
  1815.                                 write_coord(origin[0]);
  1816.                                 write_coord(origin[1]);
  1817.                                 write_coord(origin[2]+20);
  1818.                                 write_short (sprFuselight);
  1819.                                 write_byte(20);
  1820.                                 write_byte (200);
  1821.                                 message_end();
  1822.                                
  1823.                                 if (HasPrize[a][1] == 1)
  1824.                                 {
  1825.                                         times_up(a)            
  1826.                                 }
  1827.                                 else
  1828.                                 {
  1829.                                         HasPrize[a][1] -= 1;
  1830.                                         new name[32];
  1831.                                         new team[32];
  1832.                                         get_user_name(a,name,32);
  1833.                                         get_user_team(a,team,32);
  1834.                                         if(equal(team,"T", 1))
  1835.                                         {
  1836.                                                 set_hudmessage(200,0,0, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  1837.                                         }
  1838.                                         else
  1839.                                         {
  1840.                                                 set_hudmessage(0,100,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  1841.                                         }
  1842.                                         show_hudmessage(0,"%s will explode in %d seconds.",name,HasPrize[a][1]);
  1843.                                         if (HasPrize[a][1] == 11)
  1844.                                         {
  1845.                                                 client_cmd(0,"spk ^"fvox/remaining^"");
  1846.                                         }
  1847.                                         if (HasPrize[a][1] < 11)
  1848.                                         {
  1849.                                                 new temp[48];
  1850.                                                 num_to_word(HasPrize[a][1],temp,48);
  1851.                                                 client_cmd(0,"spk ^"fvox/%s^"",temp);
  1852.                                         }
  1853.                                 }
  1854.                                 if(is_user_alive(a) == 0)
  1855.                                 {
  1856.                                         times_up(a);
  1857.                                 }
  1858.                         }
  1859.                         else if(HasPrize[a][0] == PRIZE_SLAP)
  1860.                         {
  1861.                                 if (HasPrize[a][1] == 1)
  1862.                                 {
  1863.                                         times_up(a);           
  1864.                                 }
  1865.                                 else
  1866.                                 {
  1867.                                         HasPrize[a][1] -= 1;
  1868.                                         user_slap(a,5);
  1869.                                         new name[32];
  1870.                                         get_user_name(a,name,32);
  1871.                                         set_user_rendering(a,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1872.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  1873.                                         show_hudmessage(0,"%s has slap disease for %d seconds.",name,HasPrize[a][1]);
  1874.                                 }
  1875.                                 if(is_user_alive(a) == 0)
  1876.                                 {
  1877.                                         times_up(a);
  1878.                                 }
  1879.                         }
  1880.                         else if(HasPrize[a][0] == PRIZE_NIGHTCLUB)
  1881.                         {
  1882.                                 if (HasPrize[a][1] == 1)
  1883.                                 {
  1884.                                         times_up(a);   
  1885.                                 }
  1886.                                 else
  1887.                                 {
  1888.                                         HasPrize[a][1] -= 1;
  1889.                                         new name[32];
  1890.                                         get_user_name(a,name,32);
  1891.                                         set_user_rendering(a,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1892.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  1893.                                         show_hudmessage(0,"%s is in the night club for %d seconds.",name,HasPrize[a][1]);
  1894.                                 }
  1895.                                 if(is_user_alive(a) == 0)
  1896.                                 {
  1897.                                         times_up(a);
  1898.                                 }
  1899.                         }
  1900.                         else if(HasPrize[a][0] == PRIZE_SLOW)
  1901.                         {
  1902.                                 if (HasPrize[a][1] == 1)
  1903.                                 {
  1904.                                         times_up(a);
  1905.                                 }
  1906.                                 else
  1907.                                 {
  1908.                                         HasPrize[a][1] -= 1;
  1909.                                         new name[32];
  1910.                                         get_user_name(a,name,32);
  1911.                                        
  1912.                                         if(get_user_maxspeed(a) > 80)
  1913.                                                 heart_a[a] += 1;
  1914.                                        
  1915.                                         if(heart_a[a] > 2)
  1916.                                                 HasPrize[a][1] = 1;
  1917.                                        
  1918.                                         set_user_maxspeed(a,72.0);
  1919.                                         set_user_rendering(a,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1920.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  1921.                                         show_hudmessage(0,"%s is an old man for %d seconds.",name,HasPrize[a][1]);
  1922.                                 }
  1923.                                 if(is_user_alive(a) == 0)
  1924.                                 {
  1925.                                         times_up(a);
  1926.                                 }
  1927.                         }
  1928.                         else if(HasPrize[a][0] == PRIZE_SPEED)
  1929.                         {
  1930.                                 if (HasPrize[a][1] == 1)
  1931.                                 {
  1932.                                         times_up(a);
  1933.                                 }
  1934.                                 else
  1935.                                 {
  1936.                                         HasPrize[a][1] -= 1;
  1937.                                         new name[32];
  1938.                                         get_user_name(a,name,32);
  1939.                                         set_user_maxspeed(a,1000.0);
  1940.                                         set_user_rendering(a,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1941.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  1942.                                         show_hudmessage(0,"%s is a red race for %d seconds.",name,HasPrize[a][1]);
  1943.                                 }
  1944.                                 if(is_user_alive(a) == 0)
  1945.                                 {
  1946.                                         times_up(a);
  1947.                                 }      
  1948.                         }
  1949.                         else if(HasPrize[a][0] == PRIZE_INVISIBLE)
  1950.                         {
  1951.                                 if (HasPrize[a][1] == 1)
  1952.                                 {
  1953.                                         times_up(a);
  1954.                                 }
  1955.                                 else
  1956.                                 {
  1957.                                         HasPrize[a][1] -= 1;
  1958.                                         new name[32];
  1959.                                         get_user_name(a,name,32);
  1960.                                         set_user_maxspeed(a,500.0);
  1961.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  1962.                                        
  1963.                                         if (invisiblegod == 1)
  1964.                                                 show_hudmessage(0,"%s is invisible GOD for %d seconds.",name,HasPrize[a][1]);
  1965.                                        
  1966.                                         if (invisiblegod == 0)
  1967.                                                 show_hudmessage(0,"%s is invisible for %d seconds.",name,HasPrize[a][1]);
  1968.                                        
  1969.                                         set_user_rendering(a,kRenderFxNone, 0,0,0, kRenderTransAdd,5);
  1970.                                 }
  1971.                                 if(is_user_alive(a) == 0)
  1972.                                 {
  1973.                                         times_up(a);
  1974.                                 }      
  1975.                         }
  1976.                         else if(HasPrize[a][0] == PRIZE_GODMODE)
  1977.                         {
  1978.                                 if (HasPrize[a][1] == 1)
  1979.                                 {
  1980.                                         times_up(a);
  1981.                                 }
  1982.                                 else
  1983.                                 {
  1984.                                         HasPrize[a][1] -= 1;
  1985.                                         new name[32];
  1986.                                         get_user_name(a,name,32);
  1987.                                         set_user_rendering(a,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  1988.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  1989.                                         show_hudmessage(0,"%s has godmode for %d seconds.",name,HasPrize[a][1]);
  1990.                                 }
  1991.                                 if(is_user_alive(a) == 0)
  1992.                                 {
  1993.                                         times_up(a);
  1994.                                 }      
  1995.                         }
  1996.                         else if(HasPrize[a][0] == PRIZE_NOCLIP)
  1997.                         {
  1998.                                 if (HasPrize[a][1] == 1)
  1999.                                 {
  2000.                                         times_up(a)
  2001.                                 }
  2002.                                 else
  2003.                                 {
  2004.                                         HasPrize[a][1] -= 1;
  2005.                                         new name[32];
  2006.                                         get_user_name(a,name,32);
  2007.                                         set_user_rendering(a,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  2008.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2009.                                         show_hudmessage(0,"%s has noclip for %d seconds.",name,HasPrize[a][1]);
  2010.                                 }
  2011.                                 if(is_user_alive(a) == 0)
  2012.                                 {
  2013.                                         times_up(a);
  2014.                                 }
  2015.                         }
  2016.                         else if(HasPrize[a][0] == PRIZE_ZEUSMODE)
  2017.                         {
  2018.                                 if (HasPrize[a][1] == 1)
  2019.                                 {
  2020.                                         times_up(a);
  2021.                                 }
  2022.                                 else
  2023.                                 {
  2024.                                         HasPrize[a][1] -= 1;
  2025.                                         new name[32];
  2026.                                         get_user_name(a,name,32);
  2027.                                         set_user_maxspeed(a,700.0);
  2028.                                         set_user_rendering(a,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  2029.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2030.                                         show_hudmessage(0,"%s has ZEUSMODE for %d seconds.",name,HasPrize[a][1]);
  2031.                                 }
  2032.                                 if(is_user_alive(a) == 0)
  2033.                                 {
  2034.                                         times_up(a);
  2035.                                 }
  2036.                         }
  2037.                         else if(HasPrize[a][0] == PRIZE_GRAVITY)
  2038.                         {
  2039.                                 if (HasPrize[a][1] == 1)
  2040.                                 {
  2041.                                         times_up(a);
  2042.                                 }
  2043.                                 else
  2044.                                 {
  2045.                                         new name[32];
  2046.                                         get_user_name(a,name,32);
  2047.                                         set_user_rendering(a,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  2048.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2049.                                         HasPrize[a][1] -= 1;
  2050.                                        
  2051.                                         if (HasPrize[a][1] == 1)
  2052.                                         {
  2053.                                                 playsoundall("ambience/fallscream.wav");
  2054.                                                 set_user_gravity(a,30.0);
  2055.                                                 show_hudmessage(0,"%s is being dropped.",name);
  2056.                                         }
  2057.                                         else
  2058.                                         {
  2059.                                                 if (HasPrize[a][1] == HasPrize[a][1] - 1)
  2060.                                                         client_cmd(a,"+jump");
  2061.                                                
  2062.                                                 set_user_gravity(a,-50.0);
  2063.                                                 show_hudmessage(0,"%s will be dropped in %d seconds.",name,HasPrize[a][1]);
  2064.                                         }
  2065.                                 }
  2066.                                 if(is_user_alive(a) == 0)
  2067.                                 {
  2068.                                         times_up(a);
  2069.                                 }
  2070.                         }
  2071.                         else if(HasPrize[a][0] == PRIZE_LSABER)
  2072.                         {
  2073.                                 if (HasPrize[a][1] == 1)
  2074.                                 {
  2075.                                         times_up(a);
  2076.                                 }
  2077.                                 else
  2078.                                 {
  2079.                                         HasPrize[a][1] -= 1;
  2080.                                         new name[32];
  2081.                                         get_user_name(a,name,32);
  2082.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2083.                                         show_hudmessage(0,"%s is Luke Skywalker for %d seconds!",name,HasPrize[a][1]);
  2084.                                 }
  2085.                                 if(is_user_alive(a) == 0)
  2086.                                 {
  2087.                                         times_up(a);
  2088.                                 }
  2089.                         }
  2090.                         else if(HasPrize[a][0] == PRIZE_DRINKING)
  2091.                         {
  2092.                                 if (HasPrize[a][1] == 1)
  2093.                                 {
  2094.                                         times_up(a);
  2095.                                 }
  2096.                                 else
  2097.                                 {
  2098.                                         HasPrize[a][1] -= 1;
  2099.                                         new name[32];
  2100.                                         get_user_name(a,name,32);
  2101.                                         set_user_rendering(a,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  2102.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2103.                                         show_hudmessage(0,"%s is a smoking drunkard for %d seconds.",name,HasPrize[a][1]);
  2104.                                 }
  2105.                                 if(is_user_alive(a) == 0)
  2106.                                 {
  2107.                                         times_up(a);
  2108.                                 }
  2109.                         }
  2110.                         else if(HasPrize[a][0] == PRIZE_BLIND)
  2111.                         {
  2112.                                 if(is_user_alive(a) == 0)
  2113.                                 {
  2114.                                         times_up(a);
  2115.                                 }
  2116.                         }
  2117.                         else if(HasPrize[a][0] == PRIZE_UNLIMITEDAMMO)
  2118.                         {
  2119.                                 if(is_user_alive(a) == 0)
  2120.                                 {
  2121.                                         times_up(a);
  2122.                                 }
  2123.                         }
  2124.                         else if(HasPrize[a][0] == PRIZE_PARA)
  2125.                         {
  2126.                                 if (HasPrize[a][1] == 1)
  2127.                                 {
  2128.                                         times_up(a);
  2129.                                 }
  2130.                                 else
  2131.                                 {
  2132.                                         HasPrize[a][1] -= 1;
  2133.                                        
  2134.                                         if( !task_exists(66) )
  2135.                                                 set_task(0.3,"para_action",a,"",0,"a", 9999);
  2136.                                        
  2137.                                         new name[32];
  2138.                                         get_user_name(a,name,32);
  2139.  
  2140.                                         set_user_rendering(a,kRenderFxGlowShell, Red,Green,Blue, kRenderNormal,16);
  2141.                                         set_hudmessage(Red,Green,Blue, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2142.                                         show_hudmessage(0,"%s is RAMBO for %d seconds!",name,HasPrize[a][1]);
  2143.                                 }
  2144.                                 if(is_user_alive(a) == 0)
  2145.                                 {
  2146.                                         times_up(a);
  2147.                                 }
  2148.                         }
  2149.                 }
  2150.         }
  2151.        
  2152.         return PLUGIN_CONTINUE;
  2153. }
  2154.  
  2155. public times_up(id)
  2156. {
  2157.         if(id < 0)
  2158.                 return PLUGIN_CONTINUE;
  2159.                
  2160.         if(get_cvar_num("amx_dice_debug") == 2)
  2161.                 log_amx("DEBUG (Advanced Roll the Dice): Function times_up");
  2162.        
  2163.         set_task(GAMBLING_DELAY_TIME,"delay_gambling");
  2164.         new bombguyfrags;
  2165.         new bgf_message = 0;
  2166.         new maxpl = get_maxplayers() +1;
  2167.         new t;
  2168.         new players[32], inum;
  2169.         for(t=1; t < maxpl; t++)
  2170.         {
  2171.                 if (HasPrize[t][0] > 0)
  2172.                 {
  2173.                         if(HasPrize[t][0] == PRIZE_TIMEBOMB)
  2174.                         {
  2175.                                 if(id == 100)
  2176.                                 {
  2177.                                         for(new a = 1; a < maxpl; a++)
  2178.                                         {
  2179.                                                 if (HasPrize[a][1] > 0)
  2180.                                                 {
  2181.                                                         HasPrize[a][0] = 0;
  2182.                                                         HasPrize[a][1] = 0;
  2183.                                                         new name[32];
  2184.                                                         get_user_name(a,name,32);
  2185.                                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2186.                                                         show_hudmessage(0,"%s has exploded.",name);
  2187.                                                         new origin[3];
  2188.                                                         get_user_origin(a,origin);
  2189.                                                         origin[2] = origin[2] - 26;
  2190.                                                         user_kill(a,1);
  2191.                                                         explode(origin,a);
  2192.                                                         get_players(players,inum,"c");
  2193.                                                        
  2194.                                                         for(new i = 0 ;i < inum; ++i)
  2195.                                                         {
  2196.                                                                 message_begin(MSG_ONE,g_msgShake,{0,0,0},players[i])
  2197.                                                                 write_short( 1<<14 );   // shake amount
  2198.                                                                 write_short( 1<<14 );   // shake lasts this long
  2199.                                                                 write_short( 1<<14 );   // shake noise frequency
  2200.                                                                 message_end();
  2201.                                                         }
  2202.                                                        
  2203.                                                         //define TE_EXPLODEMODEL
  2204.                                                         message_begin(MSG_BROADCAST,SVC_TEMPENTITY,{0,0,0},a);
  2205.                                                         write_byte(107);        // spherical shower of models, picks from set
  2206.                                                         write_coord(origin[0]); // pos
  2207.                                                         write_coord(origin[1]);
  2208.                                                         write_coord(origin[2]);
  2209.                                                         write_coord(175);       //(velocity)
  2210.                                                         write_short (mdlGibs);  //(model index)
  2211.                                                         write_short (25);       // (count)
  2212.                                                         write_byte (100);       // (life in 0.1's)             
  2213.                                                         message_end();
  2214.                                                        
  2215.                                                         wasbomb[a] = 1;
  2216.                                                         set_user_rendering(a,kRenderFxNone, 255,255,255, kRenderNormal,16);
  2217.                                                 }
  2218.                                         }
  2219.                                 }
  2220.                                 else
  2221.                                 {
  2222.                                         new name[32];
  2223.                                         new team[32];
  2224.                                         get_user_name(id,name,32);
  2225.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2226.                                         show_hudmessage(0,"%s has exploded.",name);
  2227.                                         amx_ff = get_cvar_float("mp_friendlyfire");
  2228.                                         new origin[3];
  2229.                                         get_user_origin(id,origin);
  2230.                                         get_user_team(id, team , 32);
  2231.                                                
  2232.                                         for(new a = 1; a < maxpl; a++)
  2233.                                         {
  2234.                                                 new origin1[3];
  2235.                                                 new team1[32];
  2236.                                                 get_user_origin(a,origin1);
  2237.                                                 get_user_team(a, team1 , 32);
  2238.                                                        
  2239.                                                 if(is_user_alive(a) != 0)
  2240.                                                 {
  2241.                                                         if( ! (origin[0]-origin1[0] > BOMBKILL_RANGE || origin[0]-origin1[0] < - BOMBKILL_RANGE || origin[1]-origin1[1] > BOMBKILL_RANGE || origin[1]-origin1[1] < - BOMBKILL_RANGE ||origin[2]-origin1[2] > BOMBKILL_RANGE || origin[2]-origin1[2] < - BOMBKILL_RANGE) )
  2242.                                                         {
  2243.                                                                 if(amx_ff == 0)
  2244.                                                                 {
  2245.                                                                         if(!equal(team, team1, 1))
  2246.                                                                         {
  2247.                                                                                 client_print(a,print_chat,"[AMXX] <Dice Dealer>  Sorry, the bomb killed you.");
  2248.                                                                                        
  2249.                                                                                 if((a != id) && (bBombCredit == true))
  2250.                                                                                 {
  2251.                                                                                         bombguyfrags = get_user_frags(id);
  2252.                                                                                         bombguyfrags +=1;
  2253.                                                                                         bgf_message +=1;
  2254.                                                                                         set_user_frags(id,bombguyfrags);
  2255.                                                                                 }
  2256.                                                                                        
  2257.                                                                                 user_kill(a,1);
  2258.                                                                                 explode(origin1,a);
  2259.                                                                         }
  2260.                                                                 }
  2261.                                                                 else if(amx_ff == 1)
  2262.                                                                 {
  2263.                                                                         if(rs == false)
  2264.                                                                         {
  2265.                                                                                 client_print(a,print_chat,"[AMXX] <Dice Dealer>  Sorry, the bomb killed you.");
  2266.                                                                                
  2267.                                                                                 if((!equal(team, team1, 1)) && (bBombCredit == true) )
  2268.                                                                                 {
  2269.                                                                                         bombguyfrags = get_user_frags(id);
  2270.                                                                                         bombguyfrags +=1;
  2271.                                                                                         bgf_message +=1;
  2272.                                                                                         set_user_frags(id,bombguyfrags);
  2273.                                                                                 }
  2274.                                                                                
  2275.                                                                                 if(a != id)
  2276.                                                                                         explode(origin1,a);
  2277.                                                                                                
  2278.                                                                                 user_kill(a,1);
  2279.                                                                         }
  2280.                                                                         else
  2281.                                                                         {
  2282.                                                                                 client_print(a,print_chat,"[AMXX] <Dice Dealer>  Sorry, the bomb killed you.");
  2283.                                                                                        
  2284.                                                                                 if(a == id)
  2285.                                                                                         user_kill(a,1);  
  2286.                                                                         }                                                      
  2287.                                                                 }
  2288.                                                         }
  2289.                                                 }
  2290.                                         }
  2291.                                                
  2292.                                         HasPrize[id][0] = 0;
  2293.                                         HasPrize[id][1] = 0;
  2294.                                                
  2295.                                         if(amx_ff == 0)
  2296.                                         {
  2297.                                                 client_print(id,print_chat,"[AMXX] <Dice Dealer>  Sorry, the bomb killed you.");
  2298.                                                 user_kill(id,1);
  2299.                                         }
  2300.                                                
  2301.                                         if((bBombCredit == true) && (bgf_message > 0))
  2302.                                         {
  2303.                                                         client_print(id,print_chat,"[AMXX] <Dice Dealer>  Your bombing was a success:  You made %d KILLS.", bgf_message);
  2304.                                         }
  2305.                                        
  2306.                                         origin[2] = origin[2] - 26;
  2307.                                         explode(origin,id);
  2308.                                         get_players(players,inum,"c");
  2309.                                                
  2310.                                         for(new i = 0 ;i < inum; ++i)
  2311.                                         {
  2312.                                                 message_begin(MSG_ONE,g_msgShake,{0,0,0},players[i]);
  2313.                                                 write_short( 1<<14 );   // shake amount
  2314.                                                 write_short( 1<<14 );   // shake lasts this long
  2315.                                                 write_short( 1<<14 );   // shake noise frequency
  2316.                                                 message_end();
  2317.                                         }
  2318.                                                
  2319.                                         // define TE_EXPLODEMODEL
  2320.                                         message_begin(MSG_BROADCAST,SVC_TEMPENTITY,{0,0,0},id);
  2321.                                         write_byte(107);        // spherical shower of models, picks from set
  2322.                                         write_coord(origin[0]); // pos
  2323.                                         write_coord(origin[1]);
  2324.                                         write_coord(origin[2]);
  2325.                                         write_coord(175);       //(velocity)
  2326.                                         write_short (mdlGibs);  //(model index)
  2327.                                         write_short (25);       // (count)
  2328.                                         write_byte (100);       // (life in 0.1's)             
  2329.                                         message_end();
  2330.                                                
  2331.                                         wasbomb[id] = 1;
  2332.                                         set_user_rendering(id,kRenderFxNone, 255,255,255, kRenderNormal,16);
  2333.                                 }
  2334.                         }
  2335.                         else if(HasPrize[t][0] == PRIZE_SLAP)
  2336.                         {
  2337.                                 if(id == 100)
  2338.                                 {
  2339.                                         for(new a = 1; a < maxpl; a++)
  2340.                                         {
  2341.                                                 if (HasPrize[a][1] > 0)
  2342.                                                 {
  2343.                                                         HasPrize[a][0] = 0;
  2344.                                                         HasPrize[a][1] = 0;
  2345.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2346.                                                 }
  2347.                                         }
  2348.                                 }
  2349.                                 else
  2350.                                 {
  2351.                                         new name[32];
  2352.                                         get_user_name(id,name,32);
  2353.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2354.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2355.                                         new rand = random(4);
  2356.                                         new origin[3];
  2357.                                         get_user_origin(id,origin);
  2358.                                                
  2359.                                         if(rand > 0)
  2360.                                         {
  2361.                                                 show_hudmessage(0, "Slap disease has left %s.",name);
  2362.                                         }
  2363.                                         else
  2364.                                         {
  2365.                                                 show_hudmessage(0, "Slap disease has killed %s!",name);
  2366.                                                 user_kill(id,1);
  2367.                                                 origin[2] = origin[2] - 26;
  2368.                                                 explode(origin,id);
  2369.                                                 get_players(players,inum,"c");
  2370.                                                        
  2371.                                                 for(new i = 0 ;i < inum; ++i)
  2372.                                                 {
  2373.                                                         message_begin(MSG_ONE,g_msgShake,{0,0,0},players[i]);
  2374.                                                         write_short( 1<<14 );   // shake amount
  2375.                                                         write_short( 1<<14 );   // shake lasts this long
  2376.                                                         write_short( 1<<14 );   // shake noise frequency
  2377.                                                         message_end();
  2378.                                                 }
  2379.                                                        
  2380.                                                 // define TE_EXPLODEMODEL
  2381.                                                 message_begin(MSG_BROADCAST,SVC_TEMPENTITY,{0,0,0},id);
  2382.                                                 write_byte(107);                // spherical shower of models, picks from set
  2383.                                                 write_coord(origin[0]);         // pos
  2384.                                                 write_coord(origin[1]);
  2385.                                                 write_coord(origin[2] +26);
  2386.                                                 write_coord(175);               //(velocity)
  2387.                                                 write_short(mdlGibs);           //(model index)
  2388.                                                 write_short(25);                // (count)
  2389.                                                 write_byte (100);               // (life in 0.1's)             
  2390.                                                 message_end();
  2391.                                                        
  2392.                                                 wasbomb[id] = 1;
  2393.                                                 set_user_rendering(id,kRenderFxNone, 255,255,255, kRenderNormal,16);
  2394.                                         }
  2395.                                                
  2396.                                         HasPrize[id][0] = 0;
  2397.                                         HasPrize[id][1] = 0;
  2398.                                 }
  2399.                         }
  2400.                         else if(HasPrize[t][0] == PRIZE_NIGHTCLUB)
  2401.                         {
  2402.                                 if(id == 100)
  2403.                                 {
  2404.                                         for(new a = 1; a < maxpl; a++)
  2405.                                         {
  2406.                                                 if (HasPrize[a][1] > 0)
  2407.                                                 {
  2408.                                                         HasPrize[a][0] = 0;
  2409.                                                         HasPrize[a][1] = 0;
  2410.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2411.                                                 }
  2412.                                         }
  2413.                                 }
  2414.                                 else
  2415.                                 {
  2416.                                         new name[32];
  2417.                                         get_user_name(id,name,32);
  2418.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2419.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2420.                                         new rand = random(3);
  2421.                                         client_cmd(id, "cl_forwardspeed 400");
  2422.                                         new origin[3];
  2423.                                         get_user_origin(id,origin);
  2424.                                                
  2425.                                         if(rand > 0)
  2426.                                         {
  2427.                                                 show_hudmessage(0, "%s left the night club.",name);
  2428.                                         }
  2429.                                         else
  2430.                                         {
  2431.                                                 show_hudmessage(0, "Drugs can kill you %s!",name);
  2432.                                                 user_kill(id,1);
  2433.                                                 set_user_frags(id,(get_user_frags(id)-1));
  2434.                                                 origin[2] = origin[2] - 26;
  2435.                                                 explode(origin,id);
  2436.                                                 get_players(players,inum,"c");
  2437.                                                        
  2438.                                                 for(new i = 0 ;i < inum; ++i)
  2439.                                                 {
  2440.                                                         message_begin(MSG_ONE,g_msgShake,{0,0,0},players[i]);
  2441.                                                         write_short( 1<<14 );   // shake amount
  2442.                                                         write_short( 1<<14 );   // shake lasts this long
  2443.                                                         write_short( 1<<14 );   // shake noise frequency
  2444.                                                         message_end();
  2445.                                                 }
  2446.                                                        
  2447.                                                 // define TE_EXPLODEMODEL
  2448.                                                 message_begin(MSG_BROADCAST,SVC_TEMPENTITY,{0,0,0},id);
  2449.                                                 write_byte(107);                // spherical shower of models, picks from set
  2450.                                                 write_coord(origin[0]);         // pos
  2451.                                                 write_coord(origin[1]);
  2452.                                                 write_coord(origin[2] + 26);
  2453.                                                 write_coord(175);               //(velocity)
  2454.                                                 write_short(mdlGibs);           //(model index)
  2455.                                                 write_short(25);                // (count)
  2456.                                                 write_byte (100);               // (life in 0.1's)             
  2457.                                                 message_end();
  2458.                                                        
  2459.                                                 wasbomb[id] = 1;
  2460.                                                 set_user_rendering(id,kRenderFxNone, 255,255,255, kRenderNormal,16);
  2461.                                         }
  2462.                                                
  2463.                                         HasPrize[id][0] = 0;
  2464.                                         HasPrize[id][1] = 0;
  2465.                                 }
  2466.                         }
  2467.                         else if(HasPrize[t][0] == PRIZE_SLOW)
  2468.                         {
  2469.                                 if(id == 100)
  2470.                                 {
  2471.                                         for(new a = 1; a < maxpl; a++)
  2472.                                         {
  2473.                                                 if (HasPrize[a][1] > 0)
  2474.                                                 {
  2475.                                                         HasPrize[a][0] = 0;
  2476.                                                         HasPrize[a][1] = 0;
  2477.                                                         set_user_maxspeed(a,oldspeed[a]);
  2478.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2479.                                                 }
  2480.                                         }
  2481.                                 }
  2482.                                 else
  2483.                                 {
  2484.                                         new name[32];
  2485.                                         get_user_name(id,name,32);
  2486.                                         set_user_maxspeed(id,oldspeed[id]);
  2487.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2488.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2489.                                                
  2490.                                         if(heart_a[id] > 2)
  2491.                                         {
  2492.                                                 user_kill(id,1);
  2493.                                                 show_hudmessage(0, "%s was old and died of a heart attack.",name);
  2494.  
  2495.                                         }
  2496.                                         else
  2497.                                         {                      
  2498.                                                 show_hudmessage(0, "%s is no longer an old man.",name);
  2499.                                         }
  2500.                                                
  2501.                                         heart_a[id] = 0;
  2502.                                         HasPrize[id][0] = 0;
  2503.                                         HasPrize[id][1] = 0;
  2504.                                 }
  2505.                         }
  2506.                         else if(HasPrize[t][0] == PRIZE_SPEED)
  2507.                         {
  2508.                                 if(id == 100)
  2509.                                 {
  2510.                                         for(new a = 1; a < maxpl; a++)
  2511.                                         {
  2512.                                                 if (HasPrize[a][1] > 0)
  2513.                                                 {
  2514.                                                         HasPrize[a][0] = 0;
  2515.                                                         HasPrize[a][1] = 0;
  2516.                                                         client_cmd(a, "cl_forwardspeed 400");
  2517.                                                         set_user_maxspeed(a,oldspeed[a]);
  2518.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2519.                                                 }
  2520.                                         }
  2521.                                 }
  2522.                                 else
  2523.                                 {
  2524.                                         new name[32];
  2525.                                         get_user_name(id,name,32);
  2526.                                         client_cmd(id, "cl_forwardspeed 400");
  2527.                                         set_user_maxspeed(id,oldspeed[id]);
  2528.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2529.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2530.                                         show_hudmessage(0, "%s is out of gas.",name);
  2531.                                         HasPrize[id][0] = 0;
  2532.                                         HasPrize[id][1] = 0;
  2533.                                 }
  2534.                         }
  2535.                         else if(HasPrize[t][0] == PRIZE_INVISIBLE)
  2536.                         {
  2537.                                 if(id == 100)
  2538.                                 {
  2539.                                         for(new a = 1; a < maxpl; a++)
  2540.                                         {
  2541.                                                 if (HasPrize[a][1] > 0)
  2542.                                                 {
  2543.                                                         HasPrize[a][0] = 0;
  2544.                                                         HasPrize[a][1] = 0;
  2545.                                                         client_cmd(a, "cl_forwardspeed 400");
  2546.                                                         set_user_maxspeed(a,oldspeed[a]);
  2547.                                                         set_user_godmode(a);
  2548.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2549.                                                 }
  2550.                                         }
  2551.                                 }
  2552.                                 else
  2553.                                 {
  2554.                                         new name[32];
  2555.                                         get_user_name(id,name,32);
  2556.                                         client_cmd(id, "cl_forwardspeed 400");
  2557.                                         set_user_maxspeed(id,oldspeed[id]);
  2558.                                         set_user_godmode(id);
  2559.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2560.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2561.                                         show_hudmessage(0, "%s is no longer invisible.",name);
  2562.                                         HasPrize[id][0] = 0;
  2563.                                         HasPrize[id][1] = 0;
  2564.                                 }
  2565.                         }
  2566.                         else if(HasPrize[t][0] == PRIZE_GODMODE)
  2567.                         {
  2568.                                 if(id == 100)
  2569.                                 {
  2570.                                         for(new a = 1; a < maxpl; a++)
  2571.                                         {
  2572.                                                 if (HasPrize[a][1] > 0)
  2573.                                                 {
  2574.                                                         HasPrize[a][0] = 0;
  2575.                                                         HasPrize[a][1] = 0;
  2576.                                                         set_user_godmode(a);
  2577.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2578.                                                 }
  2579.                                         }
  2580.                                 }
  2581.                                 else
  2582.                                 {
  2583.                                         new name[32];
  2584.                                         get_user_name(id,name,32);
  2585.                                         set_user_godmode(id);
  2586.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2587.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2588.                                         show_hudmessage(0, "%s no longer has godmode.",name);
  2589.                                         HasPrize[id][0] = 0;
  2590.                                         HasPrize[id][1] = 0;
  2591.                                 }
  2592.                         }
  2593.                         else if(HasPrize[t][0] == PRIZE_NOCLIP)
  2594.                         {
  2595.                                 if(id == 100)
  2596.                                 {
  2597.                                         for(new a = 1; a < maxpl; a++)
  2598.                                         {
  2599.                                                 if (HasPrize[a][1] > 0)
  2600.                                                 {
  2601.                                                         HasPrize[a][0] = 0;
  2602.                                                         HasPrize[a][1] = 0;
  2603.                                                         set_user_noclip(a);
  2604.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2605.                                                 }
  2606.                                         }
  2607.                                 }
  2608.                                 else
  2609.                                 {
  2610.                                         new name[32];
  2611.                                         get_user_name(id,name,32);
  2612.                                         set_user_noclip(id);
  2613.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2614.                                                
  2615.                                         if (is_user_alive(id))
  2616.                                                 positionChangeTimer(id, 0.1 );
  2617.                                                
  2618.                                         HasPrize[id][0] = 0;
  2619.                                         HasPrize[id][1] = 0;
  2620.                                 }
  2621.                         }
  2622.                         else if(HasPrize[t][0] == PRIZE_ZEUSMODE)
  2623.                         {
  2624.                                 if(id == 100)
  2625.                                 {
  2626.                                         for(new a = 1; a < maxpl; a++)
  2627.                                         {
  2628.                                                 if (HasPrize[a][1] > 0)
  2629.                                                 {
  2630.                                                         HasPrize[a][0] = 0;
  2631.                                                         HasPrize[a][1] = 0;
  2632.                                                         client_cmd(a, "cl_forwardspeed 400");
  2633.                                                         set_user_godmode(a);
  2634.                                                         set_user_noclip(a);
  2635.                                                         set_user_maxspeed(a,oldspeed[a]);
  2636.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2637.                                                 }
  2638.                                         }
  2639.                                 }
  2640.                                 else
  2641.                                 {
  2642.                                         new name[32];
  2643.                                         get_user_name(id,name,32);
  2644.                                         set_user_godmode(id);
  2645.                                         set_user_noclip(id);
  2646.                                         client_cmd(id, "cl_forwardspeed 400");
  2647.                                         set_user_maxspeed(id,oldspeed[id]);
  2648.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2649.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2650.                                                
  2651.                                         if (is_user_alive(id))
  2652.                                                 positionTimer2(id, 0.1);
  2653.                                        
  2654.                                         show_hudmessage(0, "%s no longer has ZEUSMODE.",name);
  2655.                                         HasPrize[id][0] = 0;
  2656.                                         HasPrize[id][1] = 0;
  2657.                                 }
  2658.                         }
  2659.                         else if(HasPrize[t][0] == PRIZE_GRAVITY)
  2660.                         {
  2661.                                 if(id == 100)
  2662.                                 {
  2663.                                         for(new a = 1; a < maxpl; a++)
  2664.                                         {
  2665.                                                 if (HasPrize[a][1] > 0)
  2666.                                                 {
  2667.                                                         client_cmd(a,"-jump");
  2668.                                                         HasPrize[a][0] = 0;
  2669.                                                         HasPrize[a][1] = 0;
  2670.                                                         set_user_gravity(a,1.0);
  2671.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2672.                                                         new origin[3];
  2673.                                                         get_user_origin(a,origin);
  2674.                                                         origin[2] = origin[2] - 26;
  2675.                                                         explode(origin,id);
  2676.                                                         get_players(players,inum,"c");
  2677.                                                        
  2678.                                                         for(new i = 0 ;i < inum; ++i)
  2679.                                                         {
  2680.                                                                 message_begin(MSG_ONE,g_msgShake,{0,0,0},players[i]);
  2681.                                                                 write_short( 1<<14 );   // shake amount
  2682.                                                                 write_short( 1<<14 );   // shake lasts this long
  2683.                                                                 write_short( 1<<14 );   // shake noise frequency
  2684.                                                                 message_end();
  2685.                                                         }
  2686.                                                        
  2687.                                                         // define TE_EXPLODEMODEL
  2688.                                                         message_begin(MSG_BROADCAST,SVC_TEMPENTITY,{0,0,0},a);
  2689.                                                         write_byte(107);                // spherical shower of models, picks from set
  2690.                                                         write_coord(origin[0]);         // pos
  2691.                                                         write_coord(origin[1]);
  2692.                                                         write_coord(origin[2]);
  2693.                                                         write_coord(175);               //(velocity)
  2694.                                                         write_short(mdlGibs);           //(model index)
  2695.                                                         write_short(25);                // (count)
  2696.                                                         write_byte (100);               // (life in 0.1's)             
  2697.                                                         message_end();
  2698.                                                        
  2699.                                                         wasbomb[a] = 1;
  2700.                                                         set_user_rendering(a,kRenderFxNone, 255,255,255, kRenderNormal,16);
  2701.                                                 }
  2702.                                         }
  2703.                                 }
  2704.                                 else
  2705.                                 {
  2706.                                         new name[32];
  2707.                                         get_user_name(id,name,32);
  2708.                                         client_cmd(id,"-jump");
  2709.                                         set_user_gravity(id,1.0);
  2710.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2711.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2712.                                         show_hudmessage(0, "%s died of a terrible fall.",name);
  2713.                                         user_kill(id,1);
  2714.                                         new origin[3];
  2715.                                         get_user_origin(id,origin);
  2716.                                         origin[2] = origin[2] - 26;
  2717.                                         explode(origin,id);
  2718.                                         get_players(players,inum,"c");
  2719.                                                
  2720.                                         for(new i = 0 ;i < inum; ++i)
  2721.                                         {
  2722.                                                 message_begin(MSG_ONE,g_msgShake,{0,0,0},players[i]);
  2723.                                                 write_short( 1<<14 );   // shake amount
  2724.                                                 write_short( 1<<14 );   // shake lasts this long
  2725.                                                 write_short( 1<<14 );   // shake noise frequency
  2726.                                                 message_end();
  2727.                                         }
  2728.                                                
  2729.                                         HasPrize[id][0] = 0;
  2730.                                         HasPrize[id][1] = 0;
  2731.  
  2732.                                         // define TE_EXPLODEMODEL
  2733.                                         message_begin(MSG_BROADCAST,SVC_TEMPENTITY,{0,0,0},id);
  2734.                                         write_byte(107);        // spherical shower of models, picks from set
  2735.                                         write_coord(origin[0]); // pos
  2736.                                         write_coord(origin[1]);
  2737.                                         write_coord(origin[2]);
  2738.                                         write_coord(175);       //(velocity)
  2739.                                         write_short(mdlGibs);   //(model index)
  2740.                                         write_short(25);        // (count)
  2741.                                         write_byte (100);       // (life in 0.1's)             
  2742.                                         message_end();
  2743.                                                
  2744.                                         wasbomb[id] = 1;
  2745.                                         set_user_rendering(id,kRenderFxNone, 255,255,255, kRenderNormal,16);
  2746.                                 }
  2747.                         }
  2748.                         else if(HasPrize[t][0] == PRIZE_LSABER)
  2749.                         {
  2750.                                 if(id == 100)
  2751.                                 {
  2752.                                         for(new a = 1; a < maxpl; a++)
  2753.                                         {
  2754.                                                 if (HasPrize[a][1] > 0)
  2755.                                                 {
  2756.                                                         HasPrize[a][0] = 0;
  2757.                                                         HasPrize[a][1] = 0;
  2758.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2759.                                                 }
  2760.                                         }
  2761.                                 }
  2762.                                 else
  2763.                                 {
  2764.                                         new name[32];
  2765.                                         get_user_name(id,name,32);
  2766.                                         set_user_godmode(id);
  2767.                                         emit_sound(id,CHAN_ITEM, "vox/_period.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  2768.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2769.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2770.                                         show_hudmessage(0, "%s isnt Luke Skywalker now.",name);
  2771.                                         HasPrize[id][0] = 0;
  2772.                                         HasPrize[id][1] = 0;
  2773.                                 }
  2774.                         }
  2775.                         else if(HasPrize[t][0] == PRIZE_DRINKING)
  2776.                         {
  2777.                                 if(id == 100)
  2778.                                 {
  2779.                                         for(new a = 1; a < maxpl; a++)
  2780.                                         {
  2781.                                                 if (HasPrize[a][1] > 0)
  2782.                                                 {
  2783.                                                         HasPrize[a][0] = 0;
  2784.                                                         HasPrize[a][1] = 0;
  2785.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2786.                                                 }
  2787.                                         }
  2788.                                 }
  2789.                                 else
  2790.                                 {
  2791.                                         new name[32];
  2792.                                         get_user_name(id,name,32);
  2793.                                         set_user_godmode(id);
  2794.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2795.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2796.                                         show_hudmessage(0, "%s sobered up and kicked his dirty habit.",name);
  2797.                                         HasPrize[id][0] = 0;
  2798.                                         HasPrize[id][1] = 0;
  2799.                                 }
  2800.                         }
  2801.                         else if(HasPrize[t][0] == PRIZE_BLIND)
  2802.                         {
  2803.                                 if(id == 100)
  2804.                                 {
  2805.                                         for(new a = 1; a < maxpl; a++)
  2806.                                         {
  2807.                                                 if (HasPrize[a][1] > 0)
  2808.                                                 {
  2809.                                                         player_unblind(a);
  2810.                                                         HasPrize[a][0] = 0;
  2811.                                                         HasPrize[a][1] = 0;
  2812.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2813.                                                 }      
  2814.                                         }
  2815.                                 }
  2816.                                 else
  2817.                                 {
  2818.                                         player_unblind(id);
  2819.                                         HasPrize[id][0] = 0;
  2820.                                         HasPrize[id][1] = 0;
  2821.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2822.                                 }
  2823.                         }
  2824.                         else if(HasPrize[t][0] == PRIZE_UNLIMITEDAMMO)
  2825.                         {
  2826.                                 if(id == 100)
  2827.                                 {
  2828.                                         for(new a = 1; a < maxpl; a++)
  2829.                                         {
  2830.                                                 g_Hasuammo[a] = 0;
  2831.                                                 HasPrize[a][0] = 0;
  2832.                                                 HasPrize[a][1] = 0;
  2833.                                                 set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);     
  2834.                                         }
  2835.                                 }
  2836.                         }
  2837.                         else if(HasPrize[t][0] == PRIZE_PARA)
  2838.                         {
  2839.                                 if(id == 100)
  2840.                                 {
  2841.                                         for(new a = 1; a < maxpl; a++)
  2842.                                         {
  2843.                                                 if (HasPrize[a][1] > 0)
  2844.                                                 {
  2845.                                                         g_Hasuammo[a] = 0;
  2846.                                                         HasPrize[a][0] = 0;
  2847.                                                         HasPrize[a][1] = 0;
  2848.                                                         set_user_rendering(a,kRenderFxNone,255,255,255, kRenderNormal,16);
  2849.                                                 }      
  2850.                                         }
  2851.                                 }
  2852.                                 else
  2853.                                 {
  2854.                                         new name[32];
  2855.                                         get_user_name(id,name,32);
  2856.                                         set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
  2857.                                         set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  2858.                                         show_hudmessage(0, "%s is no longer RAMBO.",name);
  2859.                                         set_user_maxspeed(id,oldspeed[id]);
  2860.                                         remove_task(id);
  2861.                                                
  2862.                                         new team[32];
  2863.                                         get_user_team(id,team,32);
  2864.                        
  2865.                                         if(equal(team,"T", 1))
  2866.                                         {
  2867.                                                 give_item(id,"weapon_glock18");
  2868.                                                 give_item(id,"ammo_9mm");
  2869.                                                 give_item(id,"ammo_9mm");
  2870.                                                 give_item(id,"ammo_9mm");
  2871.                                                 give_item(id,"ammo_9mm");
  2872.                                         }
  2873.                                         else
  2874.                                         {
  2875.                                                 give_item(id,"weapon_usp");
  2876.                                                 give_item(id,"ammo_45acp");
  2877.                                                 give_item(id,"ammo_45acp");
  2878.                                                 give_item(id,"ammo_45acp");
  2879.                                                 give_item(id,"ammo_45acp");
  2880.                                         }
  2881.                                                
  2882.                                         give_item(id,"weapon_knife");
  2883.                                         HasPrize[id][0] = 0;
  2884.                                         HasPrize[id][1] = 0;
  2885.                                         g_Hasuammo[id] = 0;
  2886.                                 }      
  2887.                         }
  2888.                 }
  2889.         }
  2890.        
  2891.         return PLUGIN_CONTINUE;
  2892. }
  2893.  
  2894. explode(vec1[3],id)
  2895. {
  2896.         if(get_cvar_num("amx_dice_debug") == 2)
  2897.                 log_amx("DEBUG (Advanced Roll the Dice): Function explode");
  2898.                                
  2899.         // blast circles
  2900.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1);
  2901.         write_byte( 21 );
  2902.         write_coord(vec1[0]);
  2903.         write_coord(vec1[1]);
  2904.         write_coord(vec1[2] + 16);
  2905.         write_coord(vec1[0]);
  2906.         write_coord(vec1[1]);
  2907.         write_coord(vec1[2] + 1936);
  2908.         write_short( sprWhite );
  2909.         write_byte( 0 );        // startframe
  2910.         write_byte( 0 );        // framerate
  2911.         write_byte( 3 );        // life 2
  2912.         write_byte( 20 );       // width 16
  2913.         write_byte( 0 );        // noise
  2914.         write_byte( 188 );      // r
  2915.         write_byte( 220 );      // g
  2916.         write_byte( 255 );      // b
  2917.         write_byte( 255 );      // brightness
  2918.         write_byte( 0 );        // speed
  2919.         message_end();
  2920.    
  2921.         // Explosion2
  2922.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
  2923.         write_byte( 12 );
  2924.         write_coord(vec1[0]);
  2925.         write_coord(vec1[1]);
  2926.         write_coord(vec1[2]);
  2927.         write_byte( 188 );      // byte (scale in 0.1's) 188
  2928.         write_byte( 10 );       // byte (framerate)
  2929.         message_end();
  2930.  
  2931.         // TE_Explosion
  2932.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1);
  2933.         write_byte( 3 );
  2934.         write_coord(vec1[0]);
  2935.         write_coord(vec1[1]);
  2936.         write_coord(vec1[2]);
  2937.         write_short( sprFire );
  2938.         write_byte( 65 );       // byte (scale in 0.1's) 188
  2939.         write_byte( 10 );       // byte (framerate)
  2940.         write_byte( 0 );        // byte flags
  2941.         message_end();
  2942.  
  2943.         // TE_KILLPLAYERATTACHMENTS
  2944.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY,{0,0,0},id);
  2945.         write_byte( 125 );      // will expire all TENTS attached to a player.
  2946.         write_byte( id );       // byte (entity index of player)
  2947.         message_end()
  2948.  
  2949.         // Smoke
  2950.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1);
  2951.         write_byte( 5 );
  2952.         write_coord(vec1[0]);
  2953.         write_coord(vec1[1]);
  2954.         write_coord(vec1[2]);
  2955.         write_short( sprSmoke );
  2956.         write_byte( 50 );
  2957.         write_byte( 10 );
  2958.         message_end();
  2959. }
  2960.  
  2961. player_attachment(id)
  2962. {
  2963.         if(get_cvar_num("amx_dice_debug") == 2)
  2964.                 log_amx("DEBUG (Advanced Roll the Dice): Function player_attachment");
  2965.                
  2966.         new att_life = (HasPrize[id][1] * 10) + 20;
  2967.        
  2968.         if(att_life > 255 || att_life < 1)
  2969.                 att_life = 255;
  2970.                
  2971.         // TE_PLAYERATTACHMENT
  2972.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY,{0,0,0},id);
  2973.         write_byte ( 124 );             // attaches a TENT to a player (this is a high-priority tent)
  2974.         write_byte ( id );              // (entity index of player)
  2975.         write_coord ( 7 );              // ( attachment origin.z = player origin.z + vertical offset )
  2976.         write_short ( mdlC4bomb );              // model index
  2977.         write_short ( att_life );       // (life * 10 )
  2978.         message_end();
  2979. }
  2980.  
  2981. lightning(vec1[3],vec2[3])
  2982. {
  2983.         if(get_cvar_num("amx_dice_debug") == 2)
  2984.                 log_amx("DEBUG (Advanced Roll the Dice): Function lightning");
  2985.                
  2986.         // Lightning           
  2987.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
  2988.         write_byte( 0 );
  2989.         write_coord(vec1[0]);
  2990.         write_coord(vec1[1]);
  2991.         write_coord(vec1[2]);
  2992.         write_coord(vec2[0]);
  2993.         write_coord(vec2[1]);
  2994.         write_coord(vec2[2]);
  2995.         write_short( sprLightning );
  2996.         write_byte( 1 );        // framestart
  2997.         write_byte( 5 );        // framerate
  2998.         write_byte( 2 );        // life
  2999.         write_byte( 20 );       // width
  3000.         write_byte( 30 );       // noise
  3001.         write_byte( 200 );      // r, g, b
  3002.         write_byte( 200 );      // r, g, b
  3003.         write_byte( 200 );      // r, g, b
  3004.         write_byte( 200 );      // brightness
  3005.         write_byte( 200 );      // speed
  3006.         message_end();
  3007.    
  3008.         // Sparks
  3009.         message_begin( MSG_PVS, SVC_TEMPENTITY,vec2);
  3010.         write_byte( 9 );
  3011.         write_coord( vec2[0] );
  3012.         write_coord( vec2[1] );
  3013.         write_coord( vec2[2] );
  3014.         message_end();
  3015.    
  3016.         // Smoke      
  3017.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec2);
  3018.         write_byte( 5 );
  3019.         write_coord(vec2[0]);
  3020.         write_coord(vec2[1]);
  3021.         write_coord(vec2[2]);
  3022.         write_short( sprSmoke );
  3023.         write_byte( 10 );
  3024.         write_byte( 10 );
  3025.         message_end();
  3026. }
  3027.  
  3028. // chickengun
  3029. public mod_spawn(id)
  3030. {
  3031.         if(get_cvar_num("amx_dice_debug") == 2)
  3032.                 log_amx("DEBUG (Advanced Roll the Dice): Function mod_spawn");
  3033.                                
  3034.         new csid[1];
  3035.         csid[0] = id;
  3036.         set_task(0.3,"make_mod",1316,csid,1,"a",100);
  3037.        
  3038.         return PLUGIN_HANDLED;
  3039. }
  3040.  
  3041. // crabgun
  3042. public mod_spawn2(id)
  3043. {
  3044.         if(get_cvar_num("amx_dice_debug") == 2)
  3045.                 log_amx("DEBUG (Advanced Roll the Dice): Function mod_spawn2");
  3046.        
  3047.         new csid[1];
  3048.         csid[0] = id;
  3049.        
  3050.         if(get_cvar_num("amx_dice_monstermod") == 1)
  3051.                 set_task(2.0,"mod_spawn3",1316,csid,1,"a",10);
  3052.         else
  3053.                 set_task(0.3,"make_mod2",1316,csid,1,"a",50);
  3054.        
  3055.         return PLUGIN_HANDLED;
  3056. }
  3057.  
  3058. public mod_spawn3(id[])
  3059. {
  3060.         if(get_cvar_num("amx_dice_debug") == 2)
  3061.                 log_amx("DEBUG (Advanced Roll the Dice): Function mod_spawn3");
  3062.                                
  3063.         server_cmd("monster snark #%i",id[0]);
  3064. }
  3065.  
  3066. public sqrt(num)
  3067. {
  3068.         if(get_cvar_num("amx_dice_debug") == 2)
  3069.                 log_amx("DEBUG (Advanced Roll the Dice): Function sqrt");
  3070.                
  3071.         new div = num;
  3072.         new result = 1;
  3073.        
  3074.         while (div > result)                    // end when div == result, or just below
  3075.         {
  3076.                 div = (div + result) / 2;       // take mean value as new divisor
  3077.                 result = num / div;
  3078.         }
  3079.        
  3080.         return div;
  3081. }
  3082.  
  3083. public make_mod(id[])
  3084. {                      
  3085.         if(is_user_alive(id[0]) != 0)
  3086.         {
  3087.                 if(get_cvar_num("amx_dice_debug") == 2)
  3088.                         log_amx("DEBUG (Advanced Roll the Dice): Function make_mod");
  3089.                
  3090.                 new vec[3];
  3091.                 new aimvec[3];
  3092.                 new velocityvec[3];
  3093.                 new length;
  3094.                 new speed = 800;
  3095.                 get_user_origin(id[0],vec);
  3096.                 get_user_origin(id[0],aimvec,2);
  3097.        
  3098.                 velocityvec[0]=aimvec[0]-vec[0];
  3099.                 velocityvec[1]=aimvec[1]-vec[1];
  3100.                 velocityvec[2]=aimvec[2]-vec[2];
  3101.        
  3102.                 length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2]);
  3103.        
  3104.                 velocityvec[0]=velocityvec[0]*speed/length;
  3105.                 velocityvec[1]=velocityvec[1]*speed/length;
  3106.                 velocityvec[2]=velocityvec[2]*speed/length;
  3107.        
  3108.                 // TE_MODEL from HL-SDK common/const.h
  3109.                 message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  3110.                 write_byte(106);                // TE_MODEL index
  3111.                 write_coord(vec[0]);            // location coords
  3112.                 write_coord(vec[1]);
  3113.                 write_coord(vec[2]+20);
  3114.                 write_coord(velocityvec[0]);    // speed coords - stupid, but thats how its done
  3115.                 write_coord(velocityvec[1]);
  3116.                 write_coord(velocityvec[2]+100);
  3117.                 write_angle (0);                // yaw
  3118.                 write_short (mdlChicken);       // model
  3119.                 write_byte (2);                         // sound
  3120.                 write_byte (255);               // duration
  3121.                 message_end();
  3122.         }
  3123. }
  3124.  
  3125. public make_mod2(id[])
  3126. {                      
  3127.         if(is_user_alive(id[0]) != 0)
  3128.         {
  3129.                 if(get_cvar_num("amx_dice_debug") == 2)
  3130.                         log_amx("DEBUG (Advanced Roll the Dice): Function make_mod2");
  3131.                
  3132.                 new vec[3];
  3133.                 new aimvec[3];
  3134.                 new velocityvec[3];
  3135.                 new length;
  3136.                 new speed = 800;
  3137.                 get_user_origin(id[0],vec);
  3138.                 get_user_origin(id[0],aimvec,2);
  3139.        
  3140.                 velocityvec[0]=aimvec[0]-vec[0];
  3141.                 velocityvec[1]=aimvec[1]-vec[1];
  3142.                 velocityvec[2]=aimvec[2]-vec[2];
  3143.        
  3144.                 length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2]);
  3145.        
  3146.                 velocityvec[0]=velocityvec[0]*speed/length;
  3147.                 velocityvec[1]=velocityvec[1]*speed/length;
  3148.                 velocityvec[2]=velocityvec[2]*speed/length;
  3149.        
  3150.                 // TE_MODEL from HL-SDK common/const.h
  3151.                 message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  3152.                 write_byte(106);                // TE_MODEL index
  3153.                 write_coord(vec[0]);            // location coords
  3154.                 write_coord(vec[1]);
  3155.                 write_coord(vec[2]+20);
  3156.                 write_coord(velocityvec[0]);    // speed coords - stupid, but thats how its done
  3157.                 write_coord(velocityvec[1]);
  3158.                 write_coord(velocityvec[2]+100);
  3159.                 write_angle (0);                // yaw
  3160.                 write_short (mdlCrabs);                 // model
  3161.                 write_byte (2);                         // sound
  3162.                 write_byte (255);               // duration
  3163.                 message_end();
  3164.         }
  3165. }
  3166.  
  3167. public lightsaber(id[])
  3168. {                      
  3169.         if( (is_user_alive(id[0]) == 0) || (HasPrize[id[0]][0] != PRIZE_LSABER) )
  3170.                 return PLUGIN_CONTINUE;
  3171.                
  3172.         if(get_cvar_num("amx_dice_debug") == 2)
  3173.                 log_amx("DEBUG (Advanced Roll the Dice): Function lightsaber");
  3174.                
  3175.         new vec[3];
  3176.         new aimvec[3];
  3177.         new lseffvec[3];
  3178.         new length;
  3179.         new speed = 65;
  3180.         get_user_origin(id[0],vec,1);
  3181.         get_user_origin(id[0],aimvec,2);
  3182.         lseffvec[0]=aimvec[0]-vec[0];
  3183.         lseffvec[1]=aimvec[1]-vec[1];
  3184.         lseffvec[2]=aimvec[2]-vec[2];
  3185.         length=sqrt(lseffvec[0]*lseffvec[0]+lseffvec[1]*lseffvec[1]+lseffvec[2]*lseffvec[2]);
  3186.         lseffvec[0]=lseffvec[0]*speed/length;
  3187.         lseffvec[1]=lseffvec[1]*speed/length;
  3188.         lseffvec[2]=lseffvec[2]*speed/length;
  3189.  
  3190.         new vorigin[3];
  3191.         new maxpl = get_maxplayers() +1;
  3192.         new teama[32],teamv[32];
  3193.         get_user_team(id[0],teama,31);
  3194.        
  3195.         for(new a = 1; a < maxpl; a++)
  3196.         {                      
  3197.                 if(is_user_alive(a) != 0)
  3198.                 {
  3199.                         get_user_origin(a,vorigin);
  3200.                         if (get_distance(vec,vorigin)<100)
  3201.                         {                              
  3202.                                 if(a != id[0])
  3203.                                 {
  3204.                                         get_user_team(a,teamv,31);
  3205.                                         if(!equal(teama,teamv,2))
  3206.                                         {
  3207.                                                 if(id[1] != 0)
  3208.                                                 {
  3209.                                                         kill_player(a,id[0]);
  3210.                                                        
  3211.                                                         client_print(a,print_chat,"[AMXX] Oooh Yeeah!! Cmon Rocco! CMON!!!!! uuuhhh.");
  3212.                                                        
  3213.                                                         new gemido = random_num(0,3);
  3214.                                                        
  3215.                                                         if (gemido == 0)
  3216.                                                         {
  3217.                                                                 emit_sound(a,CHAN_VOICE, "misc/gemido01.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  3218.                                                         }
  3219.                                                         else if (gemido == 1)
  3220.                                                         {
  3221.                                                                 emit_sound(a,CHAN_VOICE, "misc/gemido02.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  3222.                                                         }
  3223.                                                         else if (gemido == 2)
  3224.                                                         {
  3225.                                                                 emit_sound(a,CHAN_VOICE, "misc/gemido03.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  3226.                                                         }
  3227.                                                         else if (gemido == 3)
  3228.                                                         {
  3229.                                                                 emit_sound(a,CHAN_VOICE, "misc/gemido04.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  3230.                                                         }
  3231.                                                 }
  3232.                                         }
  3233.                                         else if(id[1] == 2)
  3234.                                         {
  3235.                                                 kill_player(a,id[0]);
  3236.                                                
  3237.                                                 client_print(a,print_chat,"[AMXX] Oooh Yeeah!! Cmon Rocco! CMON!!!!! uuuhhh.");
  3238.                                                
  3239.                                                 new gemido = random_num(0,3);
  3240.                                                
  3241.                                                 if (gemido == 0)
  3242.                                                 {
  3243.                                                         emit_sound(a,CHAN_VOICE, "misc/gemido01.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  3244.                                                 }
  3245.                                                 else if (gemido == 1)
  3246.                                                 {
  3247.                                                         emit_sound(a,CHAN_VOICE, "misc/gemido02.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  3248.                                                 }
  3249.                                                 else if (gemido == 2)
  3250.                                                 {
  3251.                                                         emit_sound(a,CHAN_VOICE, "misc/gemido03.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  3252.                                                 }
  3253.                                                 else if (gemido == 3)
  3254.                                                 {
  3255.                                                         emit_sound(a,CHAN_VOICE, "misc/gemido04.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  3256.                                                 }
  3257.                                         }                                              
  3258.                                 }                                              
  3259.                         }
  3260.                 }
  3261.         }
  3262.  
  3263.         // beam effect between point and entity
  3264.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
  3265.         write_byte ( 1 );                       //TE_BEAMENTPOINT 1  
  3266.         write_short (id[0]);                    // ent
  3267.         write_coord (lseffvec[0]+vec[0]);       //end position
  3268.         write_coord (lseffvec[1]+vec[1]);
  3269.         write_coord (lseffvec[2]+vec[2]+10);
  3270.         write_short (sprSaber);                 // sprite
  3271.         write_byte (0);                         // start frame
  3272.         write_byte (15);                        // frame rate in 0.1's
  3273.         write_byte (1);                         // byte (life in 0.1's
  3274.         write_byte (20);                        // line width in 0.1's
  3275.         write_byte (5);                         // noise amplitude in 0.01's
  3276.         write_byte (0);                         // RGB color
  3277.         write_byte (255);
  3278.         write_byte (0);
  3279.         write_byte (255);                       // brightness
  3280.         write_byte (10);                        // scroll speed in 0.1's
  3281.         message_end();
  3282.        
  3283.         return PLUGIN_CONTINUE;
  3284. }
  3285.  
  3286. public smokin_1(id[])
  3287. {
  3288.         if( (is_user_alive(id[0])) && (HasPrize[id[0]][0] == PRIZE_DRINKING) )
  3289.         {      
  3290.                 if(get_cvar_num("amx_dice_debug") == 2)
  3291.                         log_amx("DEBUG (Advanced Roll the Dice): Function smokin_1");
  3292.                
  3293.                 new vec[3], cmd[16];
  3294.                 new a,b, y1,dfov,x1;
  3295.                
  3296.                 x1 = random_num(-40,40);
  3297.                 y1 = random_num(-40,40);
  3298.                 dcounter[id[0]] += 1;
  3299.                 get_user_origin(id[0],vec);
  3300.                
  3301.                 //Smoke    
  3302.                 message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
  3303.                 write_byte( 5 );
  3304.                 write_coord(vec[0]+x1);
  3305.                 write_coord(vec[1]+y1);
  3306.                 write_coord(vec[2]+30);
  3307.                 write_short( sprSmoke );
  3308.                 write_byte( 30 );
  3309.                 write_byte( 10 );
  3310.                 message_end();
  3311.                
  3312.                 dfov = random_num(10,120);
  3313.                 format(cmd,15,"default_fov %d",dfov);          
  3314.                 client_cmd(id[0],cmd);
  3315.                
  3316.                 if(moved[id[0]] == 1)
  3317.                 {
  3318.                         client_cmd(id[0],"-moveleft;-moveright;-forward;-back");
  3319.                         moved[id[0]] = 0;
  3320.                 }
  3321.                
  3322.                 b = random_num(0,9);
  3323.                
  3324.                 if(b == 1)
  3325.                 {
  3326.                         emit_sound(id[0],CHAN_ITEM, "misc/burp.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  3327.                         a = random_num(0,3);                   
  3328.                         client_cmd(id[0],moves[a]);
  3329.                         moved[id[0]] = 1;
  3330.                         new aimvec[3];
  3331.                         new velocityvec[3];
  3332.                         new length;
  3333.                         new speed = 500;
  3334.                         get_user_origin(id[0],aimvec,2);
  3335.                         velocityvec[0]=aimvec[0]-vec[0];
  3336.                         velocityvec[1]=aimvec[1]-vec[1];
  3337.                         velocityvec[2]=aimvec[2]-vec[2];
  3338.                         length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2]);
  3339.                         velocityvec[0]=velocityvec[0]*speed/length;
  3340.                         velocityvec[1]=velocityvec[1]*speed/length;
  3341.                         velocityvec[2]=velocityvec[2]*speed/length;
  3342.                        
  3343.                         // TE_MODEL from HL-SDK common/const.h
  3344.                         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  3345.                         write_byte(106);
  3346.                         write_coord(vec[0]);
  3347.                         write_coord(vec[1]);
  3348.                         write_coord(vec[2]+20);
  3349.                         write_coord(velocityvec[0]);
  3350.                         write_coord(velocityvec[1]);
  3351.                         write_coord(velocityvec[2]+100);
  3352.                         write_angle (0);
  3353.                         if(random(8) == 4)
  3354.                                 write_short (mdlWbottle);
  3355.                         else
  3356.                                 write_short (mdlWcan);
  3357.                         write_byte (2);
  3358.                         write_byte (255);
  3359.                         message_end();
  3360.                 }
  3361.         }
  3362.        
  3363.         if( (dcounter[id[0]] >= HasPrize[id[0]][1]*2) || (HasPrize[id[0]][0] != PRIZE_DRINKING) )
  3364.         {
  3365.                 if(moved[id[0]] == 1)
  3366.                         client_cmd(id[0],"-moveleft;-moveright;-forward;-back");
  3367.  
  3368.                 client_cmd(id[0],"default_fov 90");
  3369.         }
  3370.        
  3371.         return PLUGIN_CONTINUE;
  3372. }
  3373.  
  3374. public ignite_effects(skIndex[])
  3375. {              
  3376.         new kIndex = skIndex[0];
  3377.                
  3378.         if (is_user_alive(kIndex) && onfire[kIndex] )
  3379.         {
  3380.                 if(get_cvar_num("amx_dice_debug") == 2)
  3381.                         log_amx("DEBUG (Advanced Roll the Dice): Function ignite effects");
  3382.                
  3383.                 new korigin[3];
  3384.                 get_user_origin(kIndex,korigin);
  3385.                                
  3386.                 // TE_SPRITE - additive sprite, plays 1 cycle
  3387.                 message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
  3388.                 write_byte( 17 );
  3389.                 write_coord(korigin[0]);        // coord, coord, coord (position)
  3390.                 write_coord(korigin[1]);
  3391.                 write_coord(korigin[2]);
  3392.                 write_short( sprMflash );       // short (sprite index)
  3393.                 write_byte ( 20 );              // byte (scale in 0.1's)  
  3394.                 write_byte ( 200 );             // byte (brightness)
  3395.                 message_end();
  3396.                
  3397.                 // Smoke
  3398.                 message_begin( MSG_BROADCAST,SVC_TEMPENTITY,korigin);
  3399.                 write_byte( 5 );
  3400.                 write_coord(korigin[0]);        // coord coord coord (position)
  3401.                 write_coord(korigin[1]);
  3402.                 write_coord(korigin[2]);
  3403.                 write_short ( sprSmoke );       // short (sprite index)
  3404.                 write_byte ( 20 );              // byte (scale in 0.1's)
  3405.                 write_byte ( 15 );              // byte (framerate)
  3406.                 message_end();
  3407.                
  3408.                 set_task(0.2, "ignite_effects" , 0 , skIndex, 2);      
  3409.         }      
  3410.         else    
  3411.         {
  3412.                 if( onfire[kIndex] )  
  3413.                 {
  3414.                         emit_sound(kIndex,CHAN_AUTO, "scientist/scream21.wav", 0.6, ATTN_NORM, 0, PITCH_HIGH);
  3415.                         onfire[kIndex] = 0;
  3416.                 }
  3417.         }
  3418.        
  3419.         return PLUGIN_CONTINUE;
  3420. }
  3421.  
  3422. public ignite_player(skIndex[])
  3423. {              
  3424.         new kIndex = skIndex[0];
  3425.                
  3426.         if (is_user_alive(kIndex) && onfire[kIndex] )    
  3427.         {
  3428.                 if(get_cvar_num("amx_dice_debug") == 2)
  3429.                         log_amx("DEBUG (Advanced Roll the Dice): Function ignite_player");
  3430.                        
  3431.                 new korigin[3];
  3432.                 new players[32], inum = 0;
  3433.                 new pOrigin[3];
  3434.                 new kHeath = get_user_health(kIndex);
  3435.                 get_user_origin(kIndex,korigin);
  3436.                
  3437.                 // create some damage
  3438.                 set_user_health(kIndex,kHeath - 10);
  3439.                 message_begin(MSG_ONE, g_msgDamage, {0,0,0}, kIndex);
  3440.                 write_byte(30);                 // dmg_save
  3441.                 write_byte(30);                 // dmg_take
  3442.                 write_long(1<<21);              // visibleDamageBits
  3443.                 write_coord(korigin[0]);        // damageOrigin.x
  3444.                 write_coord(korigin[1]);        // damageOrigin.y
  3445.                 write_coord(korigin[2]);        // damageOrigin.z
  3446.                 message_end();
  3447.                                
  3448.                 // create some sound
  3449.                 emit_sound(kIndex,CHAN_ITEM, "ambience/flameburst1.wav", 0.6, ATTN_NORM, 0, PITCH_NORM);
  3450.                                
  3451.                 new team1[32];
  3452.                 get_user_team(kIndex, team1 , 32);
  3453.                 new team[32];
  3454.                 amx_ff = get_cvar_float("mp_friendlyfire");
  3455.                
  3456.                 if(amx_ff == 0)
  3457.                 {
  3458.                         get_players(players,inum,"a");
  3459.                         for(new i = 0 ;i < inum; ++i)  
  3460.                         {                                                                      
  3461.                                 get_user_origin(players[i],pOrigin);
  3462.                                 if( get_distance(korigin,pOrigin) < 100  )  
  3463.                                 {
  3464.                                         get_user_team(players[i], team , 32);
  3465.                                         if( !onfire[players[i]] )
  3466.                                         {
  3467.                                                 if(!equal(team, team1, 1))
  3468.                                                 {
  3469.                                                         new spIndex[2];
  3470.                                                         spIndex[0] = players[i];
  3471.                                                         new pName[32], kName[32];
  3472.                                                         get_user_name(players[i],pName,31);
  3473.                                                         get_user_name(kIndex,kName,31);
  3474.                                                         emit_sound(players[i],CHAN_WEAPON ,"scientist/scream07.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH);
  3475.                                                         client_print(0,3,"* [AMXX] <Dice Dealer>  OH! NO! %s burned %s!",kName,pName);
  3476.                                                         onfire[players[i]] = 1;
  3477.                                                         ignite_player(players[i]);
  3478.                                                         ignite_effects(players[i]);
  3479.                                                 }
  3480.                                         }
  3481.                                 }
  3482.                         }
  3483.                        
  3484.                         players[0] = 0;
  3485.                         pOrigin[0] = 0;
  3486.                         korigin[0] = 0;
  3487.                 }
  3488.                 else if(amx_ff == 1)
  3489.                 {
  3490.                         get_players(players,inum,"a");
  3491.                         for(new i = 0 ;i < inum; ++i)
  3492.                         {                                                                      
  3493.                                 get_user_origin(players[i],pOrigin);
  3494.                                 if( get_distance(korigin,pOrigin) < 100 )
  3495.                                 {
  3496.                                         if( !onfire[players[i]] )
  3497.                                         {
  3498.                                                 new spIndex[2];
  3499.                                                 spIndex[0] = players[i]
  3500.                                                 new pName[32], kName[32];
  3501.                                                 get_user_name(players[i],pName,31);
  3502.                                                 get_user_name(kIndex,kName,31);
  3503.                                                 emit_sound(players[i],CHAN_WEAPON ,"scientist/scream07.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH);
  3504.                                                 client_print(0,3,"* [AMXX] <Dice Dealer>  OH! NO! %s burned %s!",kName,pName);
  3505.                                                 onfire[players[i]] =1;
  3506.                                                 ignite_player(players[i]);
  3507.                                                 ignite_effects(players[i]);
  3508.                                         }                                      
  3509.                                 }
  3510.                         }
  3511.                        
  3512.                         players[0] = 0;
  3513.                         pOrigin[0] = 0;
  3514.                         korigin[0] = 0;
  3515.                 }
  3516.                
  3517.                 // Call Again in 2 seconds             
  3518.                 set_task(2.0, "ignite_player" , 0 , skIndex, 2);
  3519.         }
  3520.        
  3521.         return PLUGIN_CONTINUE;
  3522. }
  3523.  
  3524. public invisibility(id[])
  3525. {                      
  3526.         if( (is_user_alive(id[0])) && (HasPrize[id[0]][0] == PRIZE_INVISIBLE) )
  3527.         {
  3528.                 if(get_cvar_num("amx_dice_debug") == 2)
  3529.                         log_amx("DEBUG (Advanced Roll the Dice): Function invisibility");
  3530.                        
  3531.                 set_user_rendering(id[0],kRenderFxNone, 0,0,0, kRenderTransAdd,5);
  3532.         }
  3533.  
  3534.         return PLUGIN_CONTINUE;
  3535. }
  3536.  
  3537. public single_knife(id[])
  3538. {                      
  3539.         if( (is_user_alive(id[0])) && (HasPrize[id[0]][0] == PRIZE_NIGHTCLUB) )
  3540.         {
  3541.                 if(get_cvar_num("amx_dice_debug") == 2)
  3542.                         log_amx("DEBUG (Advanced Roll the Dice): Function single_knife");
  3543.                
  3544.                 client_cmd(id[0],"impulse 100");
  3545.                 new r,g,b;
  3546.                 r = random_num(0,255);
  3547.                 g = random_num(0,255);
  3548.                 b = random_num(0,255);
  3549.  
  3550.                 new korigin[3];
  3551.                 get_user_origin(id[0],korigin);
  3552.                 new wpn = read_data(2);
  3553.  
  3554.                 if (random(30) == 1)
  3555.                 {
  3556.                         //TE_SPRITE - additive sprite, plays 1 cycle
  3557.                         message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
  3558.                         write_byte( 17 );
  3559.                         write_coord(korigin[0]);        // coord, coord, coord (position)
  3560.                         write_coord(korigin[1]);
  3561.                         write_coord(korigin[2]);
  3562.                         write_short( sprMflash );               // short (sprite index)
  3563.                         write_byte ( 20 );              // byte (scale in 0.1's)  
  3564.                         write_byte ( 200 );             // byte (brightness)
  3565.                         message_end();
  3566.                 }
  3567.                 else if (random(50) == 8)
  3568.                 {
  3569.                         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  3570.                         write_byte(20);                                 // TE_BEAMDISK
  3571.                         write_coord(korigin[0]);                        // coord coord coord (center position)
  3572.                         write_coord(korigin[1]);
  3573.                         write_coord(korigin[2]);
  3574.                         write_coord(korigin[0]);                        // coord coord coord (axis and radius)
  3575.                         write_coord(korigin[1]);
  3576.                         write_coord(korigin[2]+random_num(250,750));
  3577.                        
  3578.                         switch(random_num(0,1))
  3579.                         {
  3580.                                 case 0: write_short(sprFlare6);         // short (sprite index)
  3581.                                 case 1: write_short(sprLightning);      // short (sprite index)
  3582.                         }
  3583.                        
  3584.                         write_byte(0);                          // byte (starting frame)
  3585.                         write_byte(0);                          // byte (frame rate in 0.1's)
  3586.                         write_byte(45);                         // byte (life in 0.1's)
  3587.                         write_byte(150);                        // byte (line width in 0.1's)
  3588.                         write_byte(0);                          // byte (noise amplitude in 0.01's)
  3589.                         write_byte(r);                          // byte,byte,byte (color)
  3590.                         write_byte(g);
  3591.                         write_byte(b);
  3592.                         write_byte(155);                        // byte (brightness)
  3593.                         write_byte(0);                          // byte (scroll speed in 0.1's)
  3594.                         message_end();
  3595.                 }
  3596.                 else if (random(30) == 15)
  3597.                 {
  3598.                         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  3599.                         write_byte(15);                                 // TE_SPRITETRAIL
  3600.                         write_coord(korigin[0]);                        // coord, coord, coord (start)
  3601.                         write_coord(korigin[1]);
  3602.                         write_coord(korigin[2]-20);
  3603.                         write_coord(korigin[0]);                        // coord, coord, coord (end)
  3604.                         write_coord(korigin[1]);
  3605.                         write_coord(korigin[2]+20);
  3606.                        
  3607.                         if ((r > 128) && (g < 127) && (b < 127))
  3608.                                 write_short(sprRflare);
  3609.                        
  3610.                         else if ((r < 127) && (g > 128) && (b < 127))
  3611.                                 write_short(sprGflare);
  3612.                        
  3613.                         else if ((r < 127) && (g < 127) && (b > 128))
  3614.                                 write_short(sprBflare);
  3615.                                
  3616.                         else if ((r < 127) && (g > 128) && (b > 128))
  3617.                                 write_short(sprTflare);
  3618.                                
  3619.                         else if ((r > 128) && (g < 127) && (b < 200) && (b > 100))
  3620.                                 write_short(sprPflare);
  3621.                                
  3622.                         else if ((r > 128) && (g > 128) && (b < 127))
  3623.                                 write_short(sprYflare);
  3624.                                
  3625.                         else if ((r > 128) && (g > 100) && (g < 200) && (b < 127))
  3626.                                 write_short(sprOflare);
  3627.                         else
  3628.                                 write_short(sprBflare);
  3629.                        
  3630.                         write_byte(get_cvar_num("fireworks_flare_count"));      // byte (count)
  3631.                         write_byte(10);                                         // byte (life in 0.1's)
  3632.                         write_byte(10);                                         // byte (scale in 0.1's)
  3633.                         write_byte(random_num(40,100));                         // byte (velocity along vector in 10's)
  3634.                         write_byte(40);                                         // byte (randomness of velocity in 10's)
  3635.                         message_end();
  3636.                 }
  3637.                 else if (random(30) == 26)
  3638.                 {
  3639.                         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  3640.                         write_byte(27);
  3641.                         write_coord(korigin[0]);        // coord, coord, coord (start)
  3642.                         write_coord(korigin[1]);
  3643.                         write_coord(korigin[2]);
  3644.                         write_byte(30);                 // byte (radius in 10's)
  3645.                         write_byte(r);                  // byte byte byte (color)
  3646.                         write_byte(g);
  3647.                         write_byte(b);
  3648.                         write_byte(70);                 // byte (life in 10's)
  3649.                         write_byte(11);                 // byte (decay rate in 10's)
  3650.                         message_end();
  3651.                 }
  3652.                 else if (random(10) == 7)
  3653.                 {
  3654.                         new color = random_num(0,255);
  3655.                         new width = random_num(400,1000);
  3656.                        
  3657.                         // TE_PARTICLEBURST
  3658.                         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  3659.                         write_byte(122);                // very similar to lavasplash.
  3660.                         write_coord(korigin[0]);        // coord, coord, coord (start)
  3661.                         write_coord(korigin[1]);
  3662.                         write_coord(korigin[2]);
  3663.                         write_short (width);
  3664.                         write_byte (color);             // (particle color)
  3665.                         write_byte (40);                // (duration * 10) (will be randomized a bit)
  3666.                         message_end();
  3667.                 }
  3668.                 else if (random(10) == 9)
  3669.                 {
  3670.                         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  3671.                         write_byte(14);
  3672.                         write_coord(korigin[0]);
  3673.                         write_coord(korigin[1]);
  3674.                         write_coord(korigin[2]-100);
  3675.                         write_byte(5000);               // radius
  3676.                         write_byte(80);
  3677.                         write_byte(20);
  3678.                         message_end();
  3679.                 }
  3680.                 else if (wpn == 6)
  3681.                 {
  3682.                         // nothing...
  3683.                 }
  3684.                 else
  3685.                 {
  3686.                         engclient_cmd(id[0],"weapon_knife");
  3687.                 }
  3688.         }
  3689.        
  3690.         return PLUGIN_CONTINUE;
  3691. }
  3692.  
  3693. public positionChangeTimer(id, Float: secs)
  3694. {
  3695.         if(get_cvar_num("amx_dice_debug") == 2)
  3696.                 log_amx("DEBUG (Advanced Roll the Dice): Function positionChangeTimer");
  3697.                                
  3698.         new origin[3];
  3699.         new velocity[3];
  3700.        
  3701.         if (!is_user_alive(id))
  3702.                 return;
  3703.        
  3704.         get_user_origin(id, origin, 0);
  3705.         g_lastPosition[id][0]=origin[0];
  3706.         g_lastPosition[id][1]=origin[1];
  3707.         g_lastPosition[id][2]=origin[2];
  3708.         new Float:vector[3];
  3709.         entity_get_vector(id, EV_VEC_velocity, vector);
  3710.         FVecIVec(vector, velocity);
  3711.        
  3712.         if ( velocity[0]==0 && velocity[1]==0 && velocity[2] )
  3713.         {
  3714.                 // Force a Move (small jump)
  3715.                 velocity[0]=50;
  3716.                 velocity[1]=50;
  3717.                 IVecFVec(velocity, vector);
  3718.                 entity_set_vector(id, EV_VEC_velocity, vector);
  3719.         }
  3720.        
  3721.         new parm[1];
  3722.         parm[0]=id;
  3723.         set_task(secs,"positionChangeCheck",0,parm,1);
  3724. }
  3725.  
  3726. public positionTimer2(id, Float: secs)
  3727. {
  3728.         if(get_cvar_num("amx_dice_debug") == 2)
  3729.                 log_amx("DEBUG (Advanced Roll the Dice): Function positionTimer2");
  3730.                                
  3731.         new origin[3];
  3732.         new velocity[3];
  3733.        
  3734.         if (!is_user_alive(id))
  3735.                 return;
  3736.  
  3737.         get_user_origin(id, origin, 0);
  3738.         g_lastPosition[id][0]=origin[0];
  3739.         g_lastPosition[id][1]=origin[1];
  3740.         g_lastPosition[id][2]=origin[2];
  3741.         new Float:vector[3];
  3742.         entity_get_vector(id, EV_VEC_velocity, vector);
  3743.         FVecIVec(vector, velocity);
  3744.        
  3745.         if ( velocity[0]==0 && velocity[1]==0 && velocity[2] )
  3746.         {
  3747.                 // Force a Move (small jump)
  3748.                 velocity[0]=50;
  3749.                 velocity[1]=50;
  3750.                 IVecFVec(velocity, vector);
  3751.                 entity_set_vector(id, EV_VEC_velocity, vector);
  3752.         }
  3753.        
  3754.         new parm[1];
  3755.         parm[0]=id;
  3756.         set_task(secs,"positionCheck2",0,parm,1);
  3757. }
  3758.  
  3759. public positionChangeCheck(parm[1])
  3760. {
  3761.         if(get_cvar_num("amx_dice_debug") != 0)
  3762.                 log_amx("DEBUG (Advanced Roll the Dice): Function positionChangeCheck");
  3763.                                
  3764.         new id=parm[0];
  3765.         new origin[3];
  3766.         new name[32];
  3767.         get_user_name(id,name,32);
  3768.  
  3769.         if (!is_user_alive(id))
  3770.                 return;
  3771.  
  3772.         get_user_origin(id, origin, 0);
  3773.        
  3774.         if ( g_lastPosition[id][0] == origin[0] && g_lastPosition[id][1] == origin[1] && g_lastPosition[id][2] == origin[2] && is_user_alive(id) )
  3775.         {
  3776.                 user_kill(id);
  3777.                 set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  3778.                 show_hudmessage(0, "%s got stuck and died.",name);
  3779.         }
  3780.         else
  3781.         {
  3782.                 set_hudmessage(200,255,200, 0.03, 0.62, 2, 0.02, 2.0, 0.01, 0.1, 1);
  3783.                 show_hudmessage(0, "%s no longer has noclip.",name);
  3784.         }
  3785. }
  3786.  
  3787. public positionCheck2(parm[1])
  3788. {
  3789.         if(get_cvar_num("amx_dice_debug") == 2)
  3790.                 log_amx("DEBUG (Advanced Roll the Dice): Function positionCheck2");
  3791.                                
  3792.         new id=parm[0];
  3793.         new origin[3];
  3794.         new name[32];
  3795.         get_user_name(id,name,32);
  3796.        
  3797.         if (!is_user_alive(id))
  3798.                 return;
  3799.        
  3800.         get_user_origin(id, origin, 0);
  3801.        
  3802.         if ( g_lastPosition[id][0] == origin[0] && g_lastPosition[id][1] == origin[1] && g_lastPosition[id][2] == origin[2] && is_user_alive(id) )
  3803.         {
  3804.                 client_print(id,print_chat, "[AMXX] <Dice Dealer>  You got stuck, so I teleport you where you rolled.");
  3805.                 set_user_origin(id,origen);
  3806.         }
  3807. }
  3808.  
  3809. public check_weapon(id)
  3810. {                              
  3811.         if( is_user_alive(id) != 0 && g_Hasuammo[id] == 1 )
  3812.         {
  3813.                 if(get_cvar_num("amx_dice_debug") == 2)
  3814.                         log_amx("DEBUG (Advanced Roll the Dice): Function check_weapon");
  3815.                
  3816.                 new clip = read_data(3);
  3817.  
  3818.                 if ( clip == 0 )
  3819.                         reloadAmmo(id);
  3820.         }
  3821.        
  3822.         return PLUGIN_CONTINUE;
  3823. }
  3824.  
  3825. public reloadAmmo(id)
  3826. {
  3827.         if(get_cvar_num("amx_dice_debug") == 2)
  3828.                 log_amx("DEBUG (Advanced Roll the Dice): Function reloadAmmo");
  3829.        
  3830.         new szdrop[4];
  3831.         read_argv(2,szdrop,3);
  3832.         new dropwpn = str_to_num(szdrop);
  3833.  
  3834.         if (g_ReloadTime[id] >= get_systime() - 1)
  3835.                 return;
  3836.        
  3837.         g_ReloadTime[id] = get_systime();
  3838.  
  3839.         new clip, ammo, wpn[32];
  3840.         new wpnid = get_user_weapon(id, clip, ammo);
  3841.  
  3842.         if ( wpnid == CSW_C4 || wpnid == CSW_KNIFE )
  3843.                 return;
  3844.                
  3845.         if ( wpnid == CSW_HEGRENADE || wpnid == CSW_SMOKEGRENADE || wpnid == CSW_FLASHBANG)
  3846.                 return;
  3847.  
  3848.         if ( clip == 0 )
  3849.         {
  3850.                 get_weaponname(wpnid,wpn,31);
  3851.                
  3852.                 if ( dropwpn )
  3853.                 {
  3854.                         engclient_cmd(id,"drop",wpn);
  3855.                         give_item(id, wpn);
  3856.                         engclient_cmd(id, wpn);
  3857.                 }
  3858.                 else
  3859.                 {
  3860.                         new iWPNidx = -1;
  3861.                         while ((iWPNidx = find_ent_by_class(iWPNidx, wpn)) != 0)
  3862.                         {
  3863.                                 if (id == entity_get_edict(iWPNidx, EV_ENT_owner))
  3864.                                 {
  3865.                                         cs_set_weapon_ammo(iWPNidx, getMaxClipAmmo(wpnid));
  3866.                                         break;
  3867.                                 }
  3868.                         }
  3869.                 }
  3870.         }
  3871. }
  3872.  
  3873. stock getMaxClipAmmo(wpnid)
  3874. {
  3875.         if(get_cvar_num("amx_dice_debug") == 2)
  3876.                 log_amx("DEBUG (Advanced Roll the Dice): Stock getMaxClipAmmo");
  3877.        
  3878.         new clipammo = 0;
  3879.         switch (wpnid)
  3880.         {
  3881.                 case CSW_P228           : clipammo = 13;
  3882.                 case CSW_SCOUT          : clipammo = 10;
  3883.                 case CSW_HEGRENADE      : clipammo = 0;
  3884.                 case CSW_XM1014         : clipammo = 7;
  3885.                 case CSW_C4             : clipammo = 0;
  3886.                 case CSW_MAC10          : clipammo = 30;
  3887.                 case CSW_AUG            : clipammo = 30;
  3888.                 case CSW_SMOKEGRENADE   : clipammo = 0;
  3889.                 case CSW_ELITE          : clipammo = 15;
  3890.                 case CSW_FIVESEVEN      : clipammo = 20;
  3891.                 case CSW_UMP45          : clipammo = 25;
  3892.                 case CSW_SG550          : clipammo = 30;
  3893.                 case CSW_GALI           : clipammo = 35;
  3894.                 case CSW_FAMAS          : clipammo = 25;
  3895.                 case CSW_USP            : clipammo = 12;
  3896.                 case CSW_GLOCK18        : clipammo = 20;
  3897.                 case CSW_AWP            : clipammo = 10;
  3898.                 case CSW_MP5NAVY        : clipammo = 30;
  3899.                 case CSW_M249           : clipammo = 100;
  3900.                 case CSW_M3             : clipammo = 8;
  3901.                 case CSW_M4A1           : clipammo = 30;
  3902.                 case CSW_TMP            : clipammo = 30;
  3903.                 case CSW_G3SG1          : clipammo = 20;
  3904.                 case CSW_FLASHBANG      : clipammo = 0;
  3905.                 case CSW_DEAGLE         : clipammo = 7;
  3906.                 case CSW_SG552          : clipammo = 30;
  3907.                 case CSW_AK47           : clipammo = 30;
  3908.                 case CSW_KNIFE          : clipammo = 0;
  3909.                 case CSW_P90            : clipammo = 50;
  3910.         }
  3911.        
  3912.         return clipammo;
  3913. }
  3914.  
  3915. public player_screenfade(id)
  3916. {                      
  3917.         if (HasPrize[id][0] == PRIZE_BLIND)
  3918.         {
  3919.                 if(get_cvar_num("amx_dice_debug") == 2)
  3920.                         log_amx("DEBUG (Advanced Roll the Dice): Function player_screenfade");
  3921.                        
  3922.                 set_task(0.5,"player_blind", id);
  3923.                
  3924.                 HasPrize[id][0] = 0;
  3925.  
  3926.                 return PLUGIN_HANDLED;
  3927.         }
  3928.        
  3929.         return PLUGIN_CONTINUE;
  3930. }
  3931.  
  3932. public player_blind(id)
  3933. {                      
  3934.         if (HasPrize[id][0] == PRIZE_BLIND)
  3935.         {
  3936.                 if(get_cvar_num("amx_dice_debug") == 2)
  3937.                         log_amx("DEBUG (Advanced Roll the Dice): Function player_blind");
  3938.                
  3939.                 message_begin(MSG_ONE, g_msgFade, {0,0,0}, id);         // use the magic #1 for "one client"
  3940.                 write_short( ~0 );      // fade lasts this long duration
  3941.                 write_short( ~0 );      // fade lasts this long hold time
  3942.                 write_short( 1<<12 );   // fade type
  3943.                 write_byte( 0 );        // fade red
  3944.                 write_byte( 0 );        // fade green
  3945.                 write_byte( 0 );        // fade blue  
  3946.                 write_byte( 255 );      // fade alpha  
  3947.                 message_end( );
  3948.         }
  3949. }
  3950.  
  3951. public player_unblind(id)
  3952. {
  3953.         if(get_cvar_num("amx_dice_debug") == 2)
  3954.                 log_amx("DEBUG (Advanced Roll the Dice): Function player_unblind");
  3955.                                
  3956.         message_begin(MSG_ONE, g_msgFade, {0,0,0}, id);         // use the magic #1 for "one client"  
  3957.         write_short( 1<<12 );   // fade lasts this long duration  
  3958.         write_short( 1<<8 );    // fade lasts this long hold time  
  3959.         write_short( 1<<1 );    // fade type
  3960.         write_byte( 0 );        // fade red  
  3961.         write_byte( 0 );        // fade green  
  3962.         write_byte( 0 );        // fade blue
  3963.         write_byte( 128 );      // fade alpha  
  3964.         message_end( );
  3965. }
  3966.  
  3967. public para_action(id)
  3968. {
  3969.         if(HasPrize[id][0] == PRIZE_PARA)
  3970.         {
  3971.                 if(get_cvar_num("amx_dice_debug") == 2)
  3972.                         log_amx("DEBUG (Advanced Roll the Dice): Function para_action");
  3973.                
  3974.                 new clip, ammo, weapon = get_user_weapon(id,clip,ammo);
  3975.                                
  3976.                 if(weapon != CSW_M249 || clip <= 0)
  3977.                 {
  3978.                         checkSpeed(id);
  3979.                         return PLUGIN_HANDLED;
  3980.                 }
  3981.                 if( !(get_user_button(id) & IN_ATTACK) )
  3982.                 {
  3983.                         checkSpeed(id);
  3984.                         return PLUGIN_HANDLED;
  3985.                 }
  3986.                                
  3987.                 set_user_maxspeed(id,PARA_SHOOT_SPEED);
  3988.                 wasFiring[id] = true;
  3989.         }
  3990.         return PLUGIN_CONTINUE;
  3991. }
  3992.        
  3993. public checkSpeed(id)
  3994. {
  3995.         if(get_cvar_num("amx_dice_debug") == 2)
  3996.                 log_amx("DEBUG (Advanced Roll the Dice): Function checkSpeed");
  3997.                
  3998.         if(wasFiring[id])
  3999.         {
  4000.                 wasFiring[id] = false;
  4001.                 set_user_maxspeed(id,oldspeed[id]);
  4002.         }
  4003. }
  4004.  
  4005. public event_damage(id)
  4006. {
  4007.         if (id > 0)
  4008.         {
  4009.                 if(get_cvar_num("amx_dice_debug") == 2)
  4010.                         log_amx("DEBUG (Advanced Roll the Dice): Function event_damage");
  4011.                
  4012.                 new maxplayers = get_maxplayers()+1;
  4013.                 new attacker_id = get_user_attacker (id);
  4014.        
  4015.                 if( attacker_id <= 0 || attacker_id > maxplayers || !is_user_connected(id) || !is_user_connected(attacker_id) )
  4016.                         return PLUGIN_CONTINUE;
  4017.        
  4018.                 if( HasPrize[attacker_id][0] == PRIZE_PARA && is_user_alive(id) == 1 )
  4019.                 {
  4020.                         new DoKill = 1;
  4021.                         new clip, ammo, AttackingWeapon = get_user_weapon ( attacker_id, clip, ammo );
  4022.                
  4023.                         if ( AttackingWeapon != CSW_M249 )
  4024.                                 DoKill = 0;
  4025.                
  4026.                         if ( DoKill == 1 )
  4027.                         {
  4028.                                 kill_player(id,attacker_id);
  4029.                         }
  4030.                 }
  4031.         }
  4032.        
  4033.         return PLUGIN_CONTINUE;
  4034. }
  4035.  
  4036. public kill_player(id,attacker_id)
  4037. {
  4038.         if( is_user_alive(id) == 1 && id > 0)
  4039.         {
  4040.                 if(get_cvar_num("amx_dice_debug") == 2)
  4041.                         log_amx("DEBUG (Advanced Roll the Dice): Function kill_player");
  4042.                
  4043.                 new origin[3];
  4044.                 new attacker_team[2], victim_team[2];
  4045.                 new maxplayers = get_maxplayers()+1;
  4046.                
  4047.                 if( attacker_id <= 0 || attacker_id > maxplayers || !is_user_connected(id) || !is_user_connected(attacker_id) )
  4048.                         return PLUGIN_CONTINUE;
  4049.                
  4050.                 get_user_origin ( id, origin );
  4051.                
  4052.                 // kill victim
  4053.                 user_silentkill  ( id );
  4054.                 message_begin ( MSG_ALL, get_user_msgid("DeathMsg"), {0, 0, 0}, 0 );
  4055.                 write_byte(attacker_id);
  4056.                 write_byte(id);
  4057.                 write_byte(0);
  4058.                 if ( HasPrize[attacker_id][0] == PRIZE_PARA )
  4059.                         write_string("m249");
  4060.                 else if ( HasPrize[attacker_id][0] == PRIZE_LSABER )
  4061.                         write_string("lightsaber");
  4062.                 message_end();
  4063.                        
  4064.                 // Save Hummiliation
  4065.                 new namea[24],namev[24],authida[20],authidv[20],teama[8],teamv[8];
  4066.                        
  4067.                 // Info On Attacker
  4068.                 get_user_name ( attacker_id, namea, 23 );
  4069.                 get_user_team ( attacker_id, teama, 7 );
  4070.                 get_user_authid ( attacker_id, authida, 19 );
  4071.                        
  4072.                 // Info On Victim
  4073.                 get_user_name ( id, namev, 23 );
  4074.                 get_user_team ( id, teamv, 7 );
  4075.                 get_user_authid ( id, authidv, 19 );
  4076.                        
  4077.                 // Log This Kill
  4078.                 log_message ( "^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^"", namea, get_user_userid ( attacker_id ), authida, teama, namev, get_user_userid ( id ), authidv, teamv );           
  4079.                        
  4080.                 // Check team
  4081.                 get_user_team ( attacker_id, attacker_team, 1 );
  4082.                 get_user_team ( id, victim_team, 1 );
  4083.                        
  4084.                 // Check for War3 and SHERo mods.
  4085.                 new war3xp = get_cvar_num ( "Warcraft_3_XP" );
  4086.                 new shero = get_cvar_num ( "sv_superheros" );
  4087.                 new war3ft = get_cvar_num ( "sv_warcraft3" ) ;
  4088.                        
  4089.                 if ( war3ft == 1 && war3xp != 0 )
  4090.                 {
  4091.                         war3xp = 1;
  4092.                         war3ft = 0;
  4093.                 }
  4094.                        
  4095.                 if ( war3xp != 0 )
  4096.                         war3xp = 1;
  4097.        
  4098.                 if ( !equali ( attacker_team, victim_team ) )
  4099.                 {
  4100.                         set_user_frags ( attacker_id, get_user_frags ( attacker_id ) +1 );
  4101.                         cs_set_user_money ( attacker_id, cs_get_user_money ( attacker_id ) +150 );
  4102.                                
  4103.                         if ( war3xp == 1 )
  4104.                                 server_cmd("wc3_givexp ^"%s^" %d", namea, 50 );
  4105.  
  4106.                         if ( war3ft == 1 )
  4107.                                 server_cmd("amx_givexp ^"%s^" %d", namea, 50 );
  4108.                
  4109.                         if ( shero == 1 )
  4110.                                 server_cmd("amx_shaddxp ^"%s^" %d", namea, 50 );
  4111.                 }
  4112.                 else
  4113.                 {
  4114.                         set_user_frags ( attacker_id, get_user_frags ( attacker_id ) -1 );
  4115.                         cs_set_user_money ( attacker_id, cs_get_user_money ( attacker_id ) - 500, 0 );
  4116.                                
  4117.                         if ( war3xp == 1 )
  4118.                                 server_cmd("wc3_givexp ^"%s^" -%d", namea, 150 );
  4119.                                
  4120.                         if ( war3ft == 1 )
  4121.                                 server_cmd("amx_givexp ^"%s^" -%d", namea, 150 );
  4122.                                
  4123.                         if ( shero == 1 )
  4124.                                 server_cmd("amx_shaddxp ^"%s^" -%d", namea, 150 );
  4125.                 }
  4126.         }
  4127.        
  4128.         return PLUGIN_CONTINUE;
  4129. }