Raised This Month: $51 Target: $400
 12% 

FF2 [Subplugin] Timed New Weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 05-13-2015 , 23:29   [Subplugin] Timed New Weapon
Reply With Quote #1

Update: IT WORKS! I changed it from using OnGameFrame() to SDKHooks_PreThink which handles clients much better and now the duration till removal works

The ability:
Code:
"abilityX"    // Replace the x with a number numbnuts
{
    "name" "rage_timed_new_weapon"
    "arg1"    ""    // Weapon classname
    "arg2"    ""    // Weapon index
    "arg3"    ""    // Weapon attributes(You should know how to do this, but e.g. "2 ; 3.0"(Damage bonus)
    "arg4"    ""    // Weapon slot (0: Primary, 1: Secondary, 2: Melee)
    "arg5"    ""    // Weapon off hand ammo (Or clipless weapons ammo)
    "arg6"    ""    // Weapon clip ammo
    "arg7"    "1"   // Don't change this
    "arg8"    ""    // Duration to keep the weapon, set to 0 to keep the weapon
    "plugin_name"        "ff2_timed_new_weapon"
}
It functions exactly the same as the default rage ability, only with the added benefit of limiting how long you keep the weapon

I should mention, that it probably has some redundancies in it, I'm notorious for doing that

ff2_timed_new_weapon.ff2
Attached Files
File Type: sp Get Plugin or Get Source (ff2_timed_new_weapon.sp - 353 views - 9.0 KB)
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it

Last edited by xXDeathreusXx; 05-27-2015 at 14:39. Reason: Updated
xXDeathreusXx is offline
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 05-14-2015 , 00:30   Re: [Subplugin] Timed New Weapon (Unfinished, need tips)
Reply With Quote #2

Quote:
Originally Posted by xXDeathreusXx View Post
I made this some time ago, and it used to work just fine up until I decided to swap out using clunky timers with OnGameFrame, now it will give the weapon, but not remove it.

The ability:
Code:
"abilityX"    // Replace the x with a number numbnuts
{
    "name" "rage_timed_new_weapon"
    "arg1"    ""    // Weapon classname
    "arg2"    ""    // Weapon index
    "arg3"    ""    // Weapon attributes(You should know how to do this, but e.g. "2 ; 3.0"(Damage bonus)
    "arg4"    ""    // Weapon slot (0: Primary, 1: Secondary, 2: Melee)
    "arg5"    ""    // Weapon off hand ammo (Or clipless weapons ammo)
    "arg6"    ""    // Weapon clip ammo
    "arg7"    "1"   // Don't change this
    "arg8"    ""    // Duration to keep the weapon, set to 0 to keep the weapon
    "plugin_name"        "ff2_timed_new_weapon"
}
It functions exactly the same as the default rage ability, only with the added benefit of limiting how long you keep the weapon

If people are interested in it enough, I'll return it back to the clunky timer function just so that the duration actually works, but right now I'd like to get a solution to not using a timer

I should mention, that it probably has some redundancies in it, I'm notorious for doing that

ff2_timed_new_weapon.ff2
You can use OnGameFrame() + GetEngineTime() + a float variable as a timer replacement.
__________________
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 05-14-2015 , 01:28   Re: [Subplugin] Timed New Weapon (Unfinished, need tips)
Reply With Quote #3

Quote:
Originally Posted by SHADoW NiNE TR3S View Post
You can use OnGameFrame() + GetEngineTime() + a float variable as a timer replacement.
Quote:
Originally Posted by xXDeathreusXx View Post
I made this some time ago, and it used to work just fine up until I decided to swap out using clunky timers with OnGameFrame, now it will give the weapon, but not remove it.
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 05-14-2015 , 10:32   Re: [Subplugin] Timed New Weapon (Unfinished, need tips)
Reply With Quote #4

Oh my bad
__________________
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 05-26-2015 , 19:44   Re: [Subplugin] Timed New Weapon
Reply With Quote #5

I got it working! OP is updated
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
Research
SourceMod Donor
Join Date: Nov 2011
Old 05-26-2015 , 22:01   Re: [Subplugin] Timed New Weapon
Reply With Quote #6

Thanks for new ability!

is this ability can swap same weapon?
I mean, boss default weapon is beggar's bazooka, not have secondary and melee weapon.
when boss use rage, he get 'special' beggar's bazooka.
I want to make rage like this video: https://www.youtube.com/watch?v=DZNM6D6Z3BI (2:48~)
Research is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 05-26-2015 , 23:23   Re: [Subplugin] Timed New Weapon
Reply With Quote #7

Quote:
Originally Posted by Research View Post
Thanks for new ability!

is this ability can swap same weapon?
I mean, boss default weapon is beggar's bazooka, not have secondary and melee weapon.
when boss use rage, he get 'special' beggar's bazooka.
I want to make rage like this video: https://www.youtube.com/watch?v=DZNM6D6Z3BI (2:48~)
I only added support for melee weapon swapping, and thats a bit iffy because I haven't tested it
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it

Last edited by xXDeathreusXx; 05-26-2015 at 23:23.
xXDeathreusXx is offline
neon_inferno
Senior Member
Join Date: Jan 2013
Location: Somewhere in Australia
Old 05-27-2015 , 03:16   Re: [Subplugin] Timed New Weapon
Reply With Quote #8

hey deathrues your link to the timenewweapon.ff2 goes to a sp or do we have to compile it.
neon_inferno is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 05-27-2015 , 14:38   Re: [Subplugin] Timed New Weapon
Reply With Quote #9

Quote:
Originally Posted by neon_inferno View Post
hey deathrues your link to the timenewweapon.ff2 goes to a sp or do we have to compile it.
Thanks for pointing that out, I right clicked the wrong file, is fixed
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 09-06-2015 , 06:18   Re: [Subplugin] Timed New Weapon
Reply With Quote #10

Your plugin doesn't work.

new Special[MAXPLAYERS+1];

This is never set to anything / defaults at 0, and thusly doesn't return the original weapon properly.

Yes, this statement is tested.
__________________

Last edited by Chdata; 09-06-2015 at 06:19.
Chdata 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 06:34.


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