Raised This Month: $32 Target: $400
 8% 

Group checker and thne kick


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nano2e
SourceMod Donor
Join Date: Apr 2012
Location: Australia
Old 09-02-2012 , 05:48   Group checker and thne kick
Reply With Quote #1

Im trying to add this piece of code to my tf2 pugmod

public Steam_GroupStatusResult(client, groupAccountID, bool:groupMember, bool:groupOfficer)
{
if (groupAccountID == 3957190 && !groupMember)
{
KickClient(client, "Join the group to play in this pug");
}

}

but when a player who isnt the group joins they are allowed to play, idk if im mis-using this code or it dsnt work anymore

Cheers in advanced for any help
Nano2e is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-02-2012 , 08:44  
Reply With Quote #2

You'll need to write code to detect timeouts and re-do the check.
__________________
asherkin is offline
Nano2e
SourceMod Donor
Join Date: Apr 2012
Location: Australia
Old 09-04-2012 , 04:35   Re: Group checker and thne kick
Reply With Quote #3

i wouldnt really know how to getting around to it ><
Nano2e is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-04-2012 , 09:22   Re: Group checker and thne kick
Reply With Quote #4

Quote:
Originally Posted by Nano2e View Post
i wouldnt really know how to getting around to it ><
Check the return value of Steam_RequestGroupStatus. If it's false, then the check timed out.

Also, have a

So, something like this maybe:

PHP Code:
new bool:success false;
do
{
    
success Steam_RequestGroupStatus(clientgroup);
} while (!
success); 
...although it might not be a bad idea to do Steam_IsConnected first...
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-04-2012 at 09:26.
Powerlord is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-04-2012 , 09:22   Re: Group checker and thne kick
Reply With Quote #5

Quote:
Originally Posted by Powerlord View Post
Check the return value of Steam_RequestGroupStatus. If it's false, then the check timed out.
No, you need to detect timeouts even in the case of a successful request.
__________________
asherkin is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-04-2012 , 09:27   Re: Group checker and thne kick
Reply With Quote #6

Quote:
Originally Posted by asherkin View Post
No, you need to detect timeouts even in the case of a successful request.
Yeah, I thought about that after I posted it; I'm assuming you'd need to do this via a timer.
__________________
Not currently working on SourceMod plugin development.
Powerlord 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 03:10.


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