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

Im Tired!!


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Gameplay       
Salamon
Senior Member
Join Date: Dec 2007
Location: P(r)oland
Old 07-05-2008 , 10:09   Im Tired!!
Reply With Quote #1

Im Tired!!

Description:

This plugin, makes game more realistic. When we will be running for X seconds (cvar) we will get tired and we start to walk. Another cvar is
responsible for rest points, due to after our body is tired we will run but it will be interrupted by 1 second walking. When we get tired our body will emit a breathe sound (controlled by cvar). But if our rest points will end we will walk only. To regenerate them again you must to stay still and then rest point will be consumed to regenerate run points in relation 2 run points for 1 rest point.

Cvar's:

- it_on 1/0
1 turn ON, 0 OFF plugin
- it_sound 1/0
1 turn ON breathe sound, 0 OFF
- it_run X
seconds that we can run with no problems: default 10
- it_rest X
rest points (1 rest point is 2 seconds of running): default 5
- it_minspeed X
you must have speed below this number to change rest point to run point
- it_maxspeed X
you must have speed aboce this number to waste your run points

Credits/idea:

Dunno, i think that myself xP (if such a plugin doesn't exist)

Changelog:

1.0 -> first idea and release (i think without bugs)
1.1 -> added checking if is user alive

Works:

For sure works with cs 1.6 but i've tested only on it, if you want you can test with other game ^.^

Enjoy!
Attached Files
File Type: sma Get Plugin or Get Source (im_tired.sma - 962 views - 2.9 KB)
__________________
This is 10% luck, 20% skill, 15% concentrated power of will,
5% pleasure, 50% pain and 100% reason to remember my name..

Last edited by Salamon; 07-07-2008 at 08:42.
Salamon is offline
diviqt
Senior Member
Join Date: Jul 2007
Location: Bulgaria
Old 07-05-2008 , 12:40   Re: Im Tired!!
Reply With Quote #2

this looks nice

i will give it a try ;)
diviqt is offline
Send a message via ICQ to diviqt Send a message via Skype™ to diviqt
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 07-05-2008 , 13:49   Re: Im Tired!!
Reply With Quote #3

Exelent, Very realistic
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
diviqt
Senior Member
Join Date: Jul 2007
Location: Bulgaria
Old 07-06-2008 , 06:52   Re: Im Tired!!
Reply With Quote #4

here are some bugs...


no debug

L 07/06/2008 - 13:47:12: [ENGINE] Invalid entity 20
L 07/06/2008 - 13:47:12: [AMXX] Run time error 10 (plugin "im_tired.amxx") (native "entity_get_vector") - debug not enabled!
L 07/06/2008 - 13:47:12: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes


with debug

L 07/06/2008 - 13:508: Invalid player id 21
L 07/06/2008 - 13:508: [AMXX] Displaying debug trace (plugin "im_tired.amxx")
L 07/06/2008 - 13:508: [AMXX] Run time error 10: native error (native "client_cmd")
L 07/06/2008 - 13:508: [AMXX] [0] im_tired.sma::logevent_RoundStart (line 57)
L 07/06/2008 - 13:509: [ENGINE] Invalid entity 20
L 07/06/2008 - 13:509: [AMXX] Displaying debug trace (plugin "im_tired.amxx")
L 07/06/2008 - 13:509: [AMXX] Run time error 10: native error (native "entity_get_vector")
L 07/06/2008 - 13:509: [AMXX] [0] engine_stocks.inc::get_speed (line 131)
L 07/06/2008 - 13:509: [AMXX] [1] im_tired.sma::check_speed (line 75)
L 07/06/2008 - 13:50:40: [ENGINE] Invalid entity 20
L 07/06/2008 - 13:50:40: [AMXX] Displaying debug trace (plugin "im_tired.amxx")
L 07/06/2008 - 13:50:40: [AMXX] Run time error 10: native error (native "entity_get_vector")
L 07/06/2008 - 13:50:40: [AMXX] [0] engine_stocks.inc::get_speed (line 131)
L 07/06/2008 - 13:50:40: [AMXX] [1] im_tired.sma::check_speed (line 75)
L 07/06/2008 - 13:50:41: [ENGINE] Invalid entity 20
diviqt is offline
Send a message via ICQ to diviqt Send a message via Skype™ to diviqt
Salamon
Senior Member
Join Date: Dec 2007
Location: P(r)oland
Old 07-06-2008 , 07:20   Re: Im Tired!!
Reply With Quote #5

bots ? podbots ? to be honest almost all plugins have invalid entity (id) when using on serwer only with bots (i mean locally) but on internet server working without problems
__________________
This is 10% luck, 20% skill, 15% concentrated power of will,
5% pleasure, 50% pain and 100% reason to remember my name..
Salamon is offline
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 07-06-2008 , 20:48   Re: Im Tired!!
Reply With Quote #6

There shouldn't be any errors local or not.

It is in this piece of code:
PHP Code:
for(new id 1id <= 33id++)
  {
            
client_cmd(id"-speed")
            
run[id] = get_pcvar_num(p_run)
            
rest[id] = get_pcvar_num(p_rest)
            
            if(
task_exists(123))
                
remove_task(123)
            
            
set_task(1.0"check_speed"123__"b")
  } 
You need to check if the player is connected. Under your circumstances I suggest checking if he is alive.

Also, it is in the check_speed() section.
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."

Last edited by soccdoodcss; 07-06-2008 at 20:51.
soccdoodcss is offline
Send a message via AIM to soccdoodcss
Salamon
Senior Member
Join Date: Dec 2007
Location: P(r)oland
Old 07-07-2008 , 08:43   Re: Im Tired!!
Reply With Quote #7

hmm i think u're right with checking if is user alive ;p
__________________
This is 10% luck, 20% skill, 15% concentrated power of will,
5% pleasure, 50% pain and 100% reason to remember my name..
Salamon is offline
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 07-08-2008 , 00:48   Re: Im Tired!!
Reply With Quote #8

Lol, I am right. But now if an error still occurs I will feel like an asshole.
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-08-2008 , 01:01   Re: Im Tired!!
Reply With Quote #9

Would be better to either cache get_maxplayers() into a global var and then loop from id=1 to id <= maxplayers, either use get_players.
Also, try to cache get_pcvar_XXX value before the loop ;)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 07-08-2008 , 01:58   Re: Im Tired!!
Reply With Quote #10

Quote:
Originally Posted by connorr View Post
Would be better to either cache get_maxplayers() into a global var and then loop from id=1 to id <= maxplayers, either use get_players.
Also, try to cache get_pcvar_XXX value before the loop ;)
I agree. Both will save a lot of cpu usage. The first prevents the checking of 32 players if there are only 3 on. And the second will simply retrieve the pcvars once instead of getting the same thing repeatedly.
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
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 12:38.


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