Raised This Month: $ Target: $400
 0% 

TF2: Roll the Dice RTD - v0.4


Post New Thread Reply   
 
Thread Tools Display Modes
Donski
Senior Member
Join Date: Sep 2012
Old 08-24-2014 , 14:58   Re: TF2: Roll the Dice RTD - v0.4 - NEW!
Reply With Quote #1381

sm_rtd_admin "" // Set the flag required to roll the dice. (must have all flags 'o' or 'ao')
Donski is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 09-24-2014 , 23:06   Re: TF2: Roll the Dice RTD - v0.4 - NEW!
Reply With Quote #1382

Made some modifications to the include file, this should make it easier for plugin authors to utilize. I also added two new natives.

I would like to see this added to the plugin:

PHP Code:
public APLRes:AskPluginLoad2(Handle:myselfbool:lateString:error[], err_max)
{
    
CreateNative("RTD_Roll"Native_Roll);
    
CreateNative("RTD_IsRolling"Native_Rolling); //this is the new line in this function
    
CreateNative("RTD_Terminate"Native_Terminate); //this is the other new line in this function
    
    
RegPluginLibrary("TF2: Roll the Dice");
    
    return 
APLRes_Success;
}


public 
Native_Rolling(Handle:pluginnumParams)
{
    new 
client GetNativeCell(1);
    
    if(
client >= && client <= MaxClients && IsClientInGame(client) && IsPlayerAlive(client))
    {
        if (
g_nPlayerData[client][g_nPlayerState] == STATE_IDLE)
        {
            return -
1;
        }
        else
        {
            return 
g_nPlayerData[client][g_nPlayerPerk];
        }
    }
    else
    {
        
ThrowNativeError(SP_ERROR_PARAM"Invalid client, must be in game and alive.");
        return -
1;
    }
}


public 
Native_Terminate(Handle:pluginnumParams)
{
    new 
client GetNativeCell(1);
    
    if(
client >= && client <= MaxClients && IsClientInGame(client) && IsPlayerAlive(client))
    {
        if (
g_nPlayerData[client][g_nPlayerState] == STATE_ROLLING)
        {
            
TerminateEffect(clientg_nPlayerData[client][g_nPlayerPerk]);
        }
    }
    else
    {
        
ThrowNativeError(SP_ERROR_PARAM"Invalid client, must be in game and alive.");
        return;
    }

and here is the new .inc

PHP Code:
#if defined _rtd_included
  #endinput
#endif
#define _rtd_included

public SharedPlugin:__pl_rtd 
{
    
name "TF2: Roll the Dice",
    
file "rtd.smx",
#if defined REQUIRE_PLUGIN
    
required=1,
#else
    
required=0,
#endif
};

#if !defined REQUIRE_PLUGIN
public __pl_resurrect_SetNTVOptional() {
    
MarkNativeAsOptional("RTD_Roll");
    
MarkNativeAsOptional("RTD_IsRolling");
    
MarkNativeAsOptional("RTD_Terminate");
}
#endif

enum g_eCurrentPerk
{
    
PERK_GODMODE=0,
    
PERK_TOXIC,
    
PERK_BUFFED_HEALTH,
    
PERK_SPEED,
    
PERK_NOCLIP,
    
PERK_LOW_GRAVITY,
    
PERK_UBER,
    
PERK_INVIS,
    
PERK_CLOAK,
    
PERK_CRITS,
    
PERK_INFINITE_AMMO,
    
PERK_SCARY_BULLETS,
    
PERK_SENTRY,
    
PERK_HOMING,
    
PERK_CHARGE,
    
PERK_EXPLODE,
    
PERK_SNAIL,
    
PERK_FREEZE,
    
PERK_TIMEBOMB,
    
PERK_IGNITE,
    
PERK_LOW_HEALTH,
    
PERK_DRUG,
    
PERK_BLIND,
    
PERK_MELEE,
    
PERK_BEACON,
    
PERK_TAUNT,
    
PERK_NOSTALGIA,
    
PERK_EARTHQUAKE,
    
PERK_FUNNY_FEELING,
    
PERK_SAUCE,
    
PERK_DISPENSER,
    
PERK_JUMP,
    
PERK_INSTANT_KILLS,
    
PERK_BIG_HEAD,
    
PERK_TINY_PLAYER
};

/**
 * Called everytime rtd is activated to determine if the player can use the dice mod.
 * Return Plugin_Continue to allow, anything else denies them access.
 *
 * @note The force and random admin RTD commands do not call this.
 *
 * @param client        Client Index.
 */
forward Action:RTD_CanRollDice(client);

/**
 * Roll a random effect on a given player.
 *
 * @param client        Client Index.
 * @param perk            Perk you'd like to force. Set to PERK_NONE to randomly pick one.
 */
native RTD_Roll(clientg_eCurrentPerk:nPerk=g_eCurrentPerk:-1);

/**
 * Checks if a given player is rolling the dice.
 *
 * @param client        Client Index.
 * @return                Returns the g_eCurrentPerk number of the effect,
 *                         or -1 if the player is not rolling.
 */
native g_eCurrentPerk:RTD_IsRolling(client);

/**
 * Ends the RTD effect on a given player, if the player is currently rolling.
 *
 * @param client        Client Index.
 */
native RTD_Terminate(client); 
__________________

Last edited by ddhoward; 09-25-2014 at 10:05.
ddhoward is offline
Horsedick
AlliedModders Donor
Join Date: Sep 2011
Old 09-25-2014 , 08:22   Re: TF2: Roll the Dice RTD - v0.4 - NEW!
Reply With Quote #1383

Ohh an update would be awesome right before halloween.
Horsedick is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 09-25-2014 , 08:35   Re: TF2: Roll the Dice RTD - v0.4 - NEW!
Reply With Quote #1384

It sure would, I'll get one out soon with a bunch of fixes and new effects.
__________________
pheadxdll is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 09-25-2014 , 10:05   Re: TF2: Roll the Dice RTD - v0.4 - NEW!
Reply With Quote #1385

Previous post has been updated.
__________________
ddhoward is offline
Horsedick
AlliedModders Donor
Join Date: Sep 2011
Old 09-25-2014 , 15:24   Re: TF2: Roll the Dice RTD - v0.4 - NEW!
Reply With Quote #1386

Quote:
Originally Posted by pheadxdll View Post
It sure would, I'll get one out soon with a bunch of fixes and new effects.
Horsedick is offline
Spyper
Senior Member
Join Date: Sep 2013
Old 10-03-2014 , 13:04   Re: TF2: Roll the Dice RTD - v0.4 - NEW!
Reply With Quote #1387

Quote:
Originally Posted by pheadxdll View Post
TF2: Roll the Dice
NEW VERSION 0.4!

Introduction:
This plugin is purely a fun plugin. Everything is configurable.
You cant rtd before roundstart !!!!
When you die, your sentri dies too

Last edited by Spyper; 10-03-2014 at 13:04.
Spyper is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 10-03-2014 , 14:07   Re: TF2: Roll the Dice RTD - v0.4 - NEW!
Reply With Quote #1388

Quote:
Originally Posted by Spyper View Post
You cant rtd before roundstart !!!!
When you die, your sentri dies too
sm_rtd_sentry_keep 0 // 0/1 - Keep the sentry after the effect is over.
sm_rtd_setup 1 // 0/1 - Enable or disable RTD rolls during setup.
Sreaper is offline
Donski
Senior Member
Join Date: Sep 2012
Old 10-03-2014 , 17:40   Re: TF2: Roll the Dice RTD - v0.4 - NEW!
Reply With Quote #1389

Really helps to read sometimes..
Donski is offline
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 10-10-2014 , 15:52   Re: TF2: Roll the Dice RTD - v0.4 - NEW!
Reply With Quote #1390

It would be cool for servers to be able to add their own custom effects. Maybe in addition to the rtd_effects.cfg, have another file (rtd_effects_custom.cfg?) that allows for the setup of some custom stuff for the server.

One example, since I have ION Cannon loaded on my server, it might be nice for players to get a random chance of getting the "sm_giveion" command being run for them.
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter
Weasel is offline
Reply



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 17:34.


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