Raised This Month: $ Target: $400
 0% 

Event for Player is not in Game


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sake
Senior Member
Join Date: Jul 2011
Old 07-22-2011 , 07:31   Event for Player is not in Game
Reply With Quote #1

Hello there,

Is there an event or an function that enables me to check if a player is really playing or just has minimized the game or is in the Main Menu?

And while I'm here: Are there replacement methods for spawn(id) (Fun) or set_user_godmode(id,1) (Fun)?

kind regards

sake

Last edited by sake; 07-22-2011 at 07:55.
sake is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-22-2011 , 17:55   Re: Event for Player is not in Game
Reply With Quote #2

I don't think it's possible do directly detect if the player minimized game or is in game menu but you can check if he moved/rotated or pressed a action in a certain time... that can determine if the player is afk.

Instead of spawn() (which is buggy) you could use ExecuteHam(Ham_CS_RoundRespawn, player) and instead of set_user_godmode() (which also seems buggy, dunno why) you can hook Ham_TakeDamage and check for "godmode" players and return HAM_SUPERCEDE if they are "gods"... but if set_user_godmode() works just fine you *should* use it since it's more efficient.
__________________
Hunter-Digital is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-23-2011 , 06:50   Re: Event for Player is not in Game
Reply With Quote #3

Quote:
Originally Posted by Hunter-Digital View Post
and instead of set_user_godmode() (which also seems buggy, dunno why)
Never had any problems with that native.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Old 07-23-2011, 04:16
.Dare Devil.
This message has been deleted by Seta00. Reason: Slowhacking.
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-23-2011 , 04:34   Re: Event for Player is not in Game
Reply With Quote #5

Don't try to understand last post dude.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 07-23-2011 , 06:25   Re: Event for Player is not in Game
Reply With Quote #6

He is trying to detect when <H> is pressed
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-23-2011 , 06:44   Re: Event for Player is not in Game
Reply With Quote #7

Quote:
Originally Posted by avril-lavigne View Post
He is trying to detect when <H> is pressed
Yep, *TRYING*, it's a poor method and it's slowhacking aswell, I for one have something else on H and I would be verry much pissed if I try to use it and that stupid commandmenu opens instead... so I think you understood, Dare Devil, your code is slowhacking and it's not "perfect" at all.
__________________
Hunter-Digital is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 07-23-2011 , 06:57   Re: Event for Player is not in Game
Reply With Quote #8

Quote:
Originally Posted by Hunter-Digital View Post
Yep, *TRYING*, it's a poor method and it's slowhacking aswell, I for one have something else on H and I would be verry much pissed if I try to use it and that stupid commandmenu opens instead... so I think you understood, Dare Devil, your code is slowhacking and it's not "perfect" at all.
But there are no ohter way to do this i think.
I dont like slowhacking too but something we need it.

You can do this way too like when player connect then make menu and this menu will ask him this stuff.

So if he want a godmode when he is minimized then he just choose yes and then bind him this
.Dare Devil. is offline
sake
Senior Member
Join Date: Jul 2011
Old 07-23-2011 , 09:30   Re: Event for Player is not in Game
Reply With Quote #9

Hmmm. What about trying to receive the "Esc" key command?
sake is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-23-2011 , 10:25   Re: Event for Player is not in Game
Reply With Quote #10

I dunno, I think you can hook "cancelselect" or some other command... do a debug on client_command() forward and see if it triggers something when you press escape but I doubt it.

Still, all those stuff won't actually be efficient on knowing if a player is afk, a player can be afk by actually leaving the keyboard and the game can be active... so the verry best way is to check for lack of input.
__________________
Hunter-Digital 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 01:07.


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