Raised This Month: $ Target: $400
 0% 

[ set_task + lowest value ] & [ alternative method via get_gametime() ]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cs1.7
Senior Member
Join Date: Oct 2008
Old 03-28-2010 , 12:57   [ set_task + lowest value ] & [ alternative method via get_gametime() ]
Reply With Quote #1

Hi,

i have two questions:


  • set_task: lowest value & more precise value
  1. Is the lowest value possible with set_task 0.1?
  2. Is value of 0.15 possible?

  • Can you show me how to use get_gametime() to create a function that would do the same as:

PHP Code:
public Player_Jump(id)
{

    
set_task (0.1"function"id)
}


public function(
id)
{
    
set_user_gravity(id1.0)

__________________
_____________
/_____\
[° ||| °]
./..............\▓
cs1.7 is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-28-2010 , 13:01   Re: [ set_task + lowest value ] & [ alternative method via get_gametime() ]
Reply With Quote #2

Question 1:

Yes, the lowest possible value for set_task is 0.1.

Using 0.15 is acceptable because it is five hundredths larger than 0.1.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-28-2010 , 13:03   Re: [ set_task + lowest value ] & [ alternative method via get_gametime() ]
Reply With Quote #3

1, 2 : yes.

next time, search. http://forums.alliedmods.net/showthread.php?t=43049
__________________
Arkshine is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-28-2010 , 13:38   Re: [ set_task + lowest value ] & [ alternative method via get_gametime() ]
Reply With Quote #4

Tell us what you're doing and we can help you better.
__________________
Bugsy is offline
cs1.7
Senior Member
Join Date: Oct 2008
Old 03-28-2010 , 13:47   Re: [ set_task + lowest value ] & [ alternative method via get_gametime() ]
Reply With Quote #5

Hi,

well the first question is answered. THx alot

with the sécond one i intend to see how to use get_gametime() in order to replace the set_task method in general.

As i understand it's more efficient to use the get_gametime() method instead of a set_task.
__________________
_____________
/_____\
[° ||| °]
./..............\▓
cs1.7 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-28-2010 , 13:54   Re: [ set_task + lowest value ] & [ alternative method via get_gametime() ]
Reply With Quote #6

Quote:
Originally Posted by cs1.7 View Post
Hi,

well the first question is answered. THx alot

with the sécond one i intend to see how to use get_gametime() in order to replace the set_task method in general.

As i understand it's more efficient to use the get_gametime() method instead of a set_task.
It depends on how you are calling it; if it is a one-time set_task (non repeat\loop) then that's the best way to do it. If you are calling set_task w\ flag "b" (loop) then there is a better way. What exactly are you trying to accomplish with this set_task()?
__________________
Bugsy is offline
cs1.7
Senior Member
Join Date: Oct 2008
Old 04-15-2010 , 11:31   Re: [ set_task + lowest value ] & [ alternative method via get_gametime() ]
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
What exactly are you trying to accomplish with this set_task()?
For example i want a speed plugin that gives players more speed the more the time goes on.
__________________
_____________
/_____\
[° ||| °]
./..............\▓
cs1.7 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-15-2010 , 13:44   Re: [ set_task + lowest value ] & [ alternative method via get_gametime() ]
Reply With Quote #8

ok, at what interval? How is this triggered ?
__________________
Bugsy is offline
cs1.7
Senior Member
Join Date: Oct 2008
Old 04-15-2010 , 14:16   Re: [ set_task + lowest value ] & [ alternative method via get_gametime() ]
Reply With Quote #9

I want the speed increment to be "smooth".

So you start at speed 200.00 and e.g. @every 5.0 seconds , you gain +25 speed. There should be a max speed that clients are allowed to reach. At new round all speeds are reset.



_____________________________________________ ____________


PS:

Bugy if you are interested, you could release an All-in-one speed plugin. Currently there is even no simple official speed plugin. I had to scratch this together:


PHP Code:
     #include <amxmodx> 
     #include <hamsandwich>
     #include <fun>
     
     
new speed
     
new const Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame;
  
      public 
plugin_init( )
     {
         
register_plugin"SS Speed""2.0""Jon, Arkshine, cs1.7" );
         
RegisterHamHam_Player_ResetMaxSpeed"player",  "CBasePlayer_ResetMaxSpeed");
         
speed register_cvar("ss_speed""450")
     }
     
     public 
CBasePlayer_ResetMaxSpeed ( const Player )
     {
         if ( 
is_user_alivePlayer ) && !is_user_botPlayer ))
         {
             new 
Float:MaxSpeed get_user_maxspeedPlayer );
             
             if ( 
MaxSpeed != 1.0 )
             {
                 new 
Float:MaxSpeed get_pcvar_float(speed)
                 
set_user_maxspeedPlayerMaxSpeed );
             }
         }
     } 
The All-in-One Speed plugin should be the ultimate speed plugin. It could have all the features below. The user could choose via cvar like amx_xspeed_mode which mode he wants:

  • simple speed feature. One speed for all guns. cvar like: amx_xpeed <value>
  • advanced speed feature. Different guns have different running speeds. (interesting scenarios: high knife speed only, high AWP speed only, all default cs gun running speeds + 100 speed)
  • after a kill you get faster: +1 kill = e.g. +100 speed. A cvar like: amx_xspeed_killbonus 100
  • you get faster the more time goes on: this is the current plugin i'm trying to get.
  • additionally a feature to randomly select a mode for every map could be interesting. Like: amx_xspeed_random 0/1

  • experimental: the longer you hold a direction key (W/A/S/D)..the faster you get. So you have kinda your own speed control. Like auto scooter or something . There should be a max speed limit. If you want to keep your (max) speed, you have to keep pressing the direction keys, a.k.a. run in circles or run around to not get slower.
__________________
_____________
/_____\
[° ||| °]
./..............\▓

Last edited by cs1.7; 04-15-2010 at 14:38.
cs1.7 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 00:42.


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