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

Give flag to steamid through console?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nickolay
Member
Join Date: Jan 2020
Old 05-30-2020 , 21:22   Give flag to steamid through console?
Reply With Quote #1

This is for a donation system, though is there any plugins that allows RCON to give steamid sourcemod flags?
e.g sm_giveflag {SteamID} "a"
Nickolay is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 05-30-2020 , 22:51   Re: Give flag to steamid through console?
Reply With Quote #2

If you want a very simple way to add a flag via command try using the attached addvip plugin. It will generate a new line in your admins_simple.ini file with steamid, '5' immunity, and 'a' flag. It's a plugin I modified originally written by MaTTe and Revolututzia.

Usage: sm_addvip <name or #userid>

If you don't like those attributes (5:a) you can edit this line in the code:
PHP Code:
WriteFileLine(hFile"\"%s\" \"5:a\""steamid); 
Pros: easy to use, writes new line in admins_simple.ini file entry is permanent until manually removed.
Cons: You need to use "sm_reloadadmins" command if you want the game to recognize the change during current map, the player steamid is recorded on the newly created line but the player name is not. I haven't figured out how to write //playername at the end of the new line.

Enjoy!
Attached Files
File Type: sp Get Plugin or Get Source (addvip.sp - 182 views - 1.2 KB)
PC Gamer is offline
Nickolay
Member
Join Date: Jan 2020
Old 05-31-2020 , 09:37   Re: Give flag to steamid through console?
Reply With Quote #3

Highly appreciate it, though sadly it wouldn't work as well, since I'm using the same map permanently.
Reloading causes large lag spikes, so they wouldn't get VIP before a daily restart.

Presuming sourceban's donation plugin is the only way to go from here.

Edit: I've seen servers recently using Tebex (RCON) to assign donation perks that comes instantly.
So I'm presuming there's a way to give flags without reloading admins (causing lag spikes)?

Last edited by Nickolay; 05-31-2020 at 12:06.
Nickolay is offline
TomL.
Veteran Member
Join Date: Oct 2017
Location: Germany
Old 06-01-2020 , 13:52   Re: Give flag to steamid through console?
Reply With Quote #4

If sm_reloadadmins causes large lag spikes you should check your admin/plugins list as even on a very filled server with 100s of admins it only lags for a split second.
Maybe do it on the roundstart so it won't be that noticable.
TomL. is offline
Nickolay
Member
Join Date: Jan 2020
Old 06-01-2020 , 16:49   Re: Give flag to steamid through console?
Reply With Quote #5

Quote:
Originally Posted by TomL. View Post
If sm_reloadadmins causes large lag spikes you should check your admin/plugins list as even on a very filled server with 100s of admins it only lags for a split second.
Maybe do it on the roundstart so it won't be that noticable.
It'a surf server that averages 40-48 players, the lag spike is only a split second as you say, but due to It's surf, the lag spike messes up everyone's ongoing run on the server.
Nickolay is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 06-01-2020 , 23:30   Re: Give flag to steamid through console?
Reply With Quote #6

Adding this updated version of sm_addvip for completeness. This version places the //playername at the end of the line.

New code:
PHP Code:
WriteFileLine(hFile"\"%s\" \"5:a\"  //%N"steamidtarget); 
Example output: "STEAM_0:0:1234567" "5:a" //PC Gamer
Attached Files
File Type: sp Get Plugin or Get Source (addvip.sp - 225 views - 1.2 KB)
PC Gamer is offline
Nickolay
Member
Join Date: Jan 2020
Old 06-08-2020 , 05:41   Re: Give flag to steamid through console?
Reply With Quote #7

Quote:
Originally Posted by PC Gamer View Post
If you want a very simple way to add a flag via command try using the attached addvip plugin. It will generate a new line in your admins_simple.ini file with steamid, '5' immunity, and 'a' flag. It's a plugin I modified originally written by MaTTe and Revolututzia.

Usage: sm_addvip <name or #userid>

If you don't like those attributes (5:a) you can edit this line in the code:
PHP Code:
WriteFileLine(hFile"\"%s\" \"5:a\""steamid); 
Pros: easy to use, writes new line in admins_simple.ini file entry is permanent until manually removed.
Cons: You need to use "sm_reloadadmins" command if you want the game to recognize the change during current map, the player steamid is recorded on the newly created line but the player name is not. I haven't figured out how to write //playername at the end of the new line.

Enjoy!
Does the parameter for player accept SteamID or is it solely name & userid though?
Nickolay is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 05-22-2021 , 13:45   Re: Give flag to steamid through console?
Reply With Quote #8

Updating the addvip plugin at the request of cs_McFly. This version adds an additional command of: !makevip

The new command is identical to the command: !addvip

Enjoy it cs_McFly!
Attached Files
File Type: sp Get Plugin or Get Source (addvip.sp - 91 views - 1.3 KB)
PC Gamer is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 05-23-2021 , 13:28   Re: Give flag to steamid through console?
Reply With Quote #9

Updating again, this time to remove the command !addvip. I'm told that the !addvip command is in use in another plugin and may cause a conflict. If so, use this plugin instead. It's only command is: !makevip

Note: It has the exact same functionality of previous versions. It now only has one command of: !makevip

Usage: sm_makevip <playername or #userid>
Example: !makevip robert
Attached Files
File Type: sp Get Plugin or Get Source (makevip.sp - 127 views - 1.2 KB)
PC Gamer 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 08:23.


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