Monthly Target: $400 Donations: $216
 54% 

TF2: Roll the Dice RTD - v0.4 - NEW!


Post New Thread Reply   
 
Thread Tools Display Modes
Author
pheadxdll
SourceMod Donor
Join Date: Jun 2008
Plugin ID:
496
Plugin Version:
0.4.4.2
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Approver:
    Plugin Description:
    Let's a user roll the dice for certain effects.
    Servers with this Plugin:
    1531 
    Old 08-07-2008 , 22:06   TF2: Roll the Dice RTD - v0.4 - NEW!
    Reply With Quote #1

    TF2: Roll the Dice
    NEW VERSION 0.4!

    Introduction:
    This plugin is purely a fun plugin. I had loads of fun playing on a TS server with a roll the dice plugin. Now I've ported it to TF2. It lets a user "roll the dice" by typing rtd in chat to win one of the effects listed below. After a player runs rtd they have to wait a period of time before they can do so again. Everything is configurable. The wait time, the duration of the effect, you can even disable an effect if you wish.

    Effects:
    Effects are seperated between good and bad. They are:
    Quote:
    Good Effects:
    • godmode - Invulnerability to bullets, falling, and map traps.
    • toxic - Your horrible breath kills anyone near you.
    • lucky sandvich - An instant health boost and the next shot will be a crit. Good luck!
    • faster speed - Faster move speed.
    • noclip - Fly through and walls and terrorize the other team.
    • low gravity - Lower gravity than everyone else.
    • unlimited uber - A couple seconds of uber to show the other team who's boss.
    • invisibility - Now you see me - now you don't. Go invisible - even to sentries!
    • cloak - Your spy watch won't run out for the duration of this effect.
    • crits - Constant crits without the requirement of hacks!
    • infinite ammo - No need to reload - we've got you covered!
    • scary bullets - Any players you hurt become scared like tiny babies.
    • instant sentry - Point at a spot and call for a medic to spawn a sentry.
    • homing projectiles - Rockets/arrows/flares will fly at enemies to save the bother the aiming.
    • instant charge - Your sniper rifle and bow charge up instantly.
    • dispenser pop-up - Point at a spot and call for a medic to spawn a dispenser. Stays after the effect has ended.
    • infinite double jump - The scout is no longer limited by 2 or 3 jumps.
    • instant kills - Bringin' it back, any damage you cause is fatal!
    • tiny player - You have shrunk! Use this advantage to sneak past the enemy.
    Bad Effects:
    • explode - Sorry, you exploded where you stood. Just bad luck.
    • snail - Your move speed is slowed. Might win in a race against a cozy camper sniper.
    • frozen - All movement is frozen and you become an ice sculpture.
    • timebomb - You have seconds to live. Run towards the other team to deal damage when you die.
    • spontaneous combustion - Surprise, you're on fire!
    • low health - All your health is gone. Where did it go?
    • drugged - Flashes of color and tilted vision overtake your screen to distract you.
    • blind - Who turned the lights out?
    • stripped to melee - You lose your primary and secondary weapons.
    • beacon - An energy ring and pinging sound let the enemy know where you are.
    • taunt - You can't stop taunting.
    • nostalgia - Black and white vision.
    • earthquake - A rumble shakes your screen and affects those around you.
    • funny feeling - Increases your FOV to 160. Woooah..
    • mystery sauce - You are covered in jarate and milk and bleeding out.
    • big head - Hey big head!
    CVars:
    The cvars available to you are:
    Quote:
    • sm_rtd_version
    • sm_rtd_enabled 1 // <0/1> Enable/Disable Roll The Dice.
    • sm_rtd_timelimit 120 // - Seconds before a player can roll again.
    • sm_rtd_mode 1 // <0/1/2> See below for a description.
    • sm_rtd_duration 20.0 // - Seconds that rtd effects last.
    • sm_rtd_teamlimit 1 // Team limit for mode 2.
    • sm_rtd_chance 0.5 // - <0.0-1.0> Change of a good effect.
    • sm_rtd_distance 275.0 // - Death radius for toxic kills.
    • sm_rtd_health 1000 // - Amount of health given upon health award.
    • sm_rtd_gravity 0.1 // Low gravity multiplier.
    • sm_rtd_snail 50.0 // Speed for snail effect.
    • sm_rtd_trigger "rollthedice,roll" // Chat triggers seperated by commas.
    • sm_rtd_admin "" // Set the flag required to roll the dice. (must have all flags 'o' or 'ao')
    • sm_rtd_donator "" // Set the admin flag required for donators. (must have all flags 'o' or 'ao') Activates the increased chance below.
    • sm_rtd_dchance 0.8 // Chance for a good effect if you are a donator.
    • sm_rtd_timebomb_tick 10 // Number of timebomb ticks (each a second long).
    • sm_rtd_timebomb_damage 180 // Health damage to do to enemies when timebomb goes off.
    • sm_rtd_timebomb_radius 600.0 // Radius for timebomb effect.
    • sm_rtd_blind 255 // Blind amount. Set between 0 - 255.
    • sm_rtd_beacon_radius 375 // Radius for beacon effect.
    • sm_rtd_scary 3.0 // Seconds of stun that scary bullets will deal.
    • sm_rtd_sentry_level 2 // Sentry level to be spawned during the sentry effect.
    • sm_rtd_sentry_count 1 // Number of sentries that can be spawned during the sentry effect.
    • sm_rtd_homing_speed 0.5 // Speed multiplier for homing rockets.
    • sm_rtd_homing_reflect 0.1 // Speed multiplier increase for each reflection.
    • sm_rtd_homing_crits 1 // 0/1 - Whether homing projectiles should be crits.
    • sm_rtd_fov 160 // The value to change the FOV to on the funny feeling effect.
    • sm_rtd_dispenser_level 3 // Dispenser level to spawn for effect.
    • sm_rtd_dispenser_count 1 // Number of dispensers that can be spawned during the dispenser effect.
    • sm_rtd_disabled "" // Enter the effects you'd like to disable, seperated by commas. Below are the effect keys:
      godmode,toxic,goodhealth,speed,noclip,lowgrav ity,uber,invis,cloak,crits,ammo,scary,sentry, homing,charge,explode,snail,freeze,timebomb,i gnite,badhealth,drug,blind,melee,beacon,taunt ,nostalgia,earthquake,feeling,sauce,dispenser ,jump,instant,bighead,tinyplayer
    • sm_rtd_buddah 1 // 0 - Normal godmode (no blast damage force) 1 - Buddah, takes self damage force.
    • sm_rtd_sentry_keep 0 // 0/1 - Keep the sentry after the effect is over.
    • sm_rtd_dispenser_keep 1 // 0/1 - Keep the dispenser after the effect is over.
    • sm_rtd_bighead_scale 3.0 // Multipler to scale the player's head for the 'big head' perk. 1.0 is regular size.
    • sm_rtd_tinyplayer_scale 0.1 // Multiple to scale the player model for the 'tiny player' perk. 1.0 is regular size.
    • sm_rtd_respawn_stuck 1 // 0/1 - Respawn if player is stuck after 'noclip' or 'tiny player' perks.
    • sm_rtd_setup 1 // 0/1 - Enable or disable RTD rolls during setup.
    • sm_rtd_debug_effects 0 // 0/1 - Enable or disable logging effects on roll.
    Config File:
    A config file: configs/rtd_effects.cfg is now included to give you more control:
    Quote:
    • Disable individual effects
    • Set a specific duration for an effect. For example to make godmode shorter than other effects.
    • Good/Bad
    • Name or description
    Commands:
    Quote:
    • rtd
      Regular chat command that players can use to roll the device. Checks for ! in front automatically. Set more triggers with sm_rtd_trigger.
    • effects
      Chat command that players can type to bring up a menu with each perk with it's description.
    • sm_forcertd <target/#userid> perk_index/perk_key
      Example: sm_forcertd @me 0 or sm_forcertd @me godmode do the same thing.
      Forces a player to RTD. Perk_index is a number, leave it blank to randomly choose. Perk indices can be found in configs/rtd_effects.cfg.
    • sm_randomrtd <target/#userid>
      Forces a random player to roll the dice.
    • sm_rtd_reloadconfigs
      Reloads rtd_effects.cfg so you do not have to restart the server.
    Natives:
    Natives are available for other plugins in rtd.inc:

    Quote:
    • forward Action:RTD_CanRollDice(client);
    • native RTD_Roll(client, g_eCurrentPerk:nPerk=g_eCurrentPerk:-1);
    • Example: Restricts players rolling the dice to only one team. Red or blue. Uses the cvar: sm_rtd_team 2 // 2 - red or 3 - blu to set the team. download source
      Useful for gamemodes like VSH where you want only one side that can rtd.
    Roll The Dice Modes:
    There are three different modes (0/1/2) that govern when users can Roll The Dice during the game. Read each one and change sm_rtd_mode to the one you want:
    • 0 : Roll the Dice free for all. Players can roll anytime they want, as long as they don't exceed sm_rtd_timelimit.
    • 1 : Legacy mode. Only one player can roll the dice at a time.
    • 2 : Team limit mode. Only a certain amount of players can roll at a given time, on a given team. Set sm_rtd_teamlimit for your team limit amount. Default teamlimit value is 1.

    Translation support! It'll be easier to translate rtd into the language that your server runs on. If you speak another language, please post your translation file. Add your language without replacing/removing the english lines.

    Perk suggestion? Go ahead and post here for feedback. No promises! As always, post bugs and errors in this thread so that they can be fixed.

    Hope you enjoy this release!

    Version History:
    Code:
    • v0.4.4.2 - Fixed ammo bug for infinite ammo perk. - Added cvar sm_rtd_debug_effects to log when players roll. Default off, set to 1 to enable.
    • v0.4.4.1 - Added improvements to homing rocket code. - sm_forcertd now can take a perk key in addition to the numerical index to reference a forced perk. Ex: sm_forcertd @me godmode - Added sm_rtd_homing_crits to change whether homing projectiles should be crits. Default 1 (on).
    • v0.4.4 - Fixed arena round logic and tweaked the round detection code. Added a cvar sm_rtd_setup to set whether you can roll during Setup. Default is 1 (yes). - Added two cvars: sm_rtd_dispenser_keep & sm_rtd_sentry_keep to set whether dispensers and sentries spawned during their respective perks will stay after the effect is over. By default the dispensers will stay, sentries will not. (1 and 0). - Added two perks: big head and tiny player. You can set the size by sm_rtd_bighead_scale and sm_rtd_tinyplayer_scale. (Default 3.0 and 0.1 respectively). - Added a cvar sm_rtd_respawn_stuck to set whether the plugin should respawn players if they appear to be stuck after the tiny player or noclip perks. Default is yes (1). - Fixed a bug where deaths by non-player causes did not trigger the RTD effect termination. - Fixed advert on round start showing when the rtd is disabled or when the round isn't ready.
    • v0.4.3.4 - Added a small bug fix to homing rockets.
    • v0.4.3.3 - Fixed powerup canteens not becoming invisible with player perk.
    • v0.4.3.2 - Fixed conflict with the aimbot module of SMAC.
    • v0.4.3.1 - Fixed a small logic bug that caused an error during homing rocket detection.
    • v0.4.3 - Added two good perks: Instant Kills & Infinite Scout Jumps - Changed infinite ammo to include energy weapons & engineer metal. - Changed godmode to default to buddah. Added a cvar sm_rtd_buddah to let you set this value back to before. - Changed how frozen works and set scary bullets attacker to 0.
    • v0.4.2 - Added back the sm_rtd_disabled cvar used to disable certain rtd effects. Update rtd_effects.cfg!
    • v0.4.1 - Fixed a bug where rtd got stuck in the waiting for players period.
    • v0.4 - New effects: sentry/dispenser pop-up, homing rockets, infinite ammo, scary bullets, nostalgia, earthquake, funny feeling, lucky sandvich, infinite charge, timebomb (now hurts enemies), freeze (turns you into an icicle), sauce, and others. Incorporated effects from the old Presents plugin. - Updated to make use of features from the latest version of SourceMod. - Fixed invisibility bugs and made sentries not target invisible players. - Cannibalized timebomb, beacon, and drug code into this plugin to avoid bugs with instant respawn. - Updated to make use of the new chat color possibilities. - Added a description menu so players can learn what each perk does. Chat command: effects - Changed to a chat listener to read chat. Now reads both with the ! in front and without for any chat trigger. - Added the ability to force a specific perk for testing. Requires the perk index in rtd_effects.cfg. - Added new particles and sound for better notification. - Noclip now checks to see if you are stuck and will respawn you accordingly. - Uses SDKHooks for TakeDamage and changes the death icons & weapon_logclassname in the death event. - Added a config file: rtd_effects.cfg to let you set a custom time for a perk or disable any as you see fit. - Added some natives. - Complete code rewrite.
    Custom admin menu made by panchoman here.

    Install Instructions:
    Five steps:
    1. Install SDKHooks.
    2. Place rtd.smx into your plugins/ folder.
    3. Place rtd.phrases.txt into your translation/ folder.
    4. Place rtd_effects.cfg into your configs/ folder.
    5. Restart server.
    Attached Files
    File Type: cfg rtd_effects.cfg (5.3 KB, 16733 views)
    File Type: inc rtd.inc (1.3 KB, 7424 views)
    File Type: txt rtd.phrases.txt (7.3 KB, 14090 views)
    File Type: sp Get Plugin or Get Source (rtd.sp - 5500 views - 99.6 KB)
    File Type: smx rtd.smx (47.7 KB, 14024 views)

    Last edited by pheadxdll; 03-21-2013 at 22:47.
    pheadxdll is offline
    FredJed223
    Senior Member
    Join Date: Feb 2008
    Old 08-07-2008 , 22:20   Re: TF2: Roll the Dice
    Reply With Quote #2

    I have been waiting for this!. Testing now!

    Thanks!

    EDIT: This appears to work for the first person that uses the command. Then gets stuck on the next person that uses it, and whenever someone else try's to use it, it says that its busy with X player.
    It does this for the rest of the map and even after map change. If I unload it and reload it, then it works one time again then locks stuck on a person...

    Besides that This plugin is great thanks.

    EDIT2: also dosent seem to compile properly

    "//// rtd.sp
    // rtd.sp(1023) : warning 213: tag mismatch
    // Header size: 4628 bytes
    // Code size: 22500 bytes
    // Data size: 4520 bytes
    // Stack/heap size: 16384 bytes; Total requirements: 48032 bytes
    //
    // 1 Warning.
    //
    // Compilation Time: 0.33 sec
    // ----------------------------------------"

    Last edited by FredJed223; 08-07-2008 at 22:39.
    FredJed223 is offline
    russell99ky
    Member
    Join Date: Apr 2008
    Old 08-07-2008 , 22:30   Re: TF2: Roll the Dice
    Reply With Quote #3

    Got it up on my server looks like the 1st person to do rtd it does not get off them, not even when they are slayed!
    russell99ky is offline
    russell99ky
    Member
    Join Date: Apr 2008
    Old 08-07-2008 , 22:36   Re: TF2: Roll the Dice
    Reply With Quote #4

    got this error msg:


    L 08/07/2008 - 215:18: [SM] Native "KillTimer" reported: Invalid timer handle 5fd00a8 (error 3)
    L 08/07/2008 - 215:18: [SM] Debug mode is not enabled for "rtd.smx"
    L 08/07/2008 - 215:18: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 24 on
    L 08/07/2008 - 215:18: [SM] Native "KillTimer" reported: Invalid timer handle 5fd00a8 (error 3)
    L 08/07/2008 - 215:18: [SM] Debug mode is not enabled for "rtd.smx"
    L 08/07/2008 - 215:18: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 24 on
    russell99ky is offline
    pheadxdll
    SourceMod Donor
    Join Date: Jun 2008
    Old 08-07-2008 , 22:43   Re: TF2: Roll the Dice
    Reply With Quote #5

    You'll need to ignore that compile error. That part of the code works fine.

    This is horrible. I'm puzzled why its not working for you guys. It works fine on 1.1.0.2423. Could you tell me what version of sourcemod you are using?
    pheadxdll is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 08-07-2008 , 22:48   Re: TF2: Roll the Dice
    Reply With Quote #6

    Quote:
    Originally Posted by pheadxdll View Post
    You'll need to ignore that compile error. That part of the code works fine.
    Actually, it doesn't (or at least shouldn't). You can't return strings through a function. Either use datapacks or just use GetClientName instead of your custom function.
    bl4nk is offline
    russell99ky
    Member
    Join Date: Apr 2008
    Old 08-07-2008 , 22:49   Re: TF2: Roll the Dice
    Reply With Quote #7

    SourceMod (1.0.3)
    russell99ky is offline
    FredJed223
    Senior Member
    Join Date: Feb 2008
    Old 08-07-2008 , 22:51   Re: TF2: Roll the Dice
    Reply With Quote #8

    1.0.4 also, and I get errors in my logs:

    SM] Debug mode is not enabled for "rtd.smx"
    L 08/07/2008 - 22:47:48: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 43 on
    L 08/07/2008 - 22:48:41: [SM] Plugin encountered error 15: Array index is out of bounds

    AND:

    [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 43 on
    L 08/07/2008 - 22:29:28: [SM] Native "KillTimer" reported: Invalid timer handle c7c20124 (error 3)
    L 08/07/2008 - 22:29:28: [SM] Debug mode is not enabled for "rtd.smx"
    FredJed223 is offline
    pheadxdll
    SourceMod Donor
    Join Date: Jun 2008
    Old 08-07-2008 , 23:04   Re: TF2: Roll the Dice
    Reply With Quote #9

    Quote:
    Originally Posted by bl4nk View Post
    Actually, it doesn't (or at least shouldn't). You can't return strings through a function. Either use datapacks or just use GetClientName instead of your custom function.
    It shouldn't work, but it does. I'll do the latter tho and fix that. Does 1.0 allow you kill non repeatable timers? I'm not sure what else to make of those errors. Maybe someone that knows the difference b/t 1.0 and 1.1 can go over my code and tell me what isn't compatible. It does work fine on my 1.1 server.
    pheadxdll is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 08-07-2008 , 23:09   Re: TF2: Roll the Dice
    Reply With Quote #10

    Yes, you can kill non-repeating timers. Just use CloseHandle() on the timer handle. Also, remember that you don't have to close non-repeating timers on their callback. They'll automatically close once the callback has fully been ran through.
    bl4nk is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 03:15.


    Powered by vBulletin®
    Copyright ©2000 - 2015, vBulletin Solutions, Inc.
    Theme made by Freecode