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

[TF2] Updating VIP during match?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Samg381
Junior Member
Join Date: May 2023
Old 05-28-2023 , 21:04   [TF2] Updating VIP during match?
Reply With Quote #1

Hello,

I wrote a script to detect donators in an SQL database.

I want to promote them to the @VIP group as soon as they are detected, even if a match is underway.

Right now I am updating admins_simple.ini and running sm_reloadadmins, but this causes a massive lagspike. Is there a better way to instantly promote a user to a group without lag?
Samg381 is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 05-29-2023 , 18:26   Re: [TF2] Updating VIP during match?
Reply With Quote #2

Since you posted this in the scripting section I'll assume you want some tips on using code to add a steam id and flag to the admins_simple.ini fole. This link is to a thread that should help to point you in the right direction.

Link: https://forums.alliedmods.net/showthread.php?t=324893

Enjoy!

Last edited by PC Gamer; 05-29-2023 at 18:26.
PC Gamer is offline
Samg381
Junior Member
Join Date: May 2023
Old 05-29-2023 , 20:37   Re: [TF2] Updating VIP during match?
Reply With Quote #3

Quote:
Originally Posted by PC Gamer View Post
Since you posted this in the scripting section I'll assume you want some tips on using code to add a steam id and flag to the admins_simple.ini fole. This link is to a thread that should help to point you in the right direction.

Link: https://forums.alliedmods.net/showthread.php?t=324893

Enjoy!
Thank you for the response! Apologies if I posted this in the wrong area.

I actually am already writing to the admins_simple.ini file- my trouble is getting the changes to apply while a round is underway. I tried the 'reloadadmins' command, however this causes a massive lag spike. Is there any way to temporarily add a flag to a user until the map changes and the .ini file is formally read?
Samg381 is offline
Samg381
Junior Member
Join Date: May 2023
Old 05-29-2023 , 22:15   Re: [TF2] Updating VIP during match?
Reply With Quote #4

I will add that I have tried several variations of the following code to no avail:

Code:
char groupName[] = "VIP"; // I have a group named VIP in admin_groups I want to set the user to.

AdminId admin = CreateAdmin(groupName);
GroupId grpId = FindAdmGroup(groupName);
		
int flags = grpId.GetFlags();
		
AdminFlag adminflags;
BitToFlag(flags, adminflags);
		
admin.SetFlag(adminflags, true);
		
SetUserAdmin(client, admin, true);

My whole goal is to give the user VIP instantly, so other plugins / perks can kick in.

Last edited by Samg381; 05-29-2023 at 22:16.
Samg381 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 05-30-2023 , 02:00   Re: [TF2] Updating VIP during match?
Reply With Quote #5

Well, it should be alright,
Code:
SetUserAdmin
should give the user permission assuming the other parameters are correct.

I know there is a command to scan a player and check it's permissions, have you tried a simple plugin like
Code:
!giveflag z
that only does something like
Code:
SetUserAdmin(...)
and check your permission afterward ?

I am thinking that it might be another plugin overriding your permission upon connection or so.
__________________
Want to check my plugins ?
Arkarr 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 04:12.


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