Simple Plugin does not work.
Hello Guys,
I've got problem w/ simple code. Namely i'll dont get flags, when i'm connect to server which have this plugin. Please help me fix it :D Code:
#include <sourcemod> |
Re: Simple Plugin does not work.
I've never tried adding flags like you are, but I've found that that steamID format can be unreliable, try using steam64:
PHP Code:
Also, use OnClientPostAdminCheck instead of OnClientAuthorized. https://sm.alliedmods.net/new-api/cl...ientAuthorized |
Re: Simple Plugin does not work.
The 'auth' field returns the same value as what 'AuthId_Steam2' returns using GetClientAuthId so you can just check for that using StrEqual instead.
|
Re: Simple Plugin does not work.
Also make sure you check Steam ID's properly!
GetClientAuthId returns a boolean of TRUE/FALSE: Code:
if (GetClientAuthId(client, AuthId_Steam2, steamId, sizeof(steamId))) { Code:
if (GetClientAuthId(client, AuthId_Steam2, steamId, sizeof(steamId))) { |
Re: Simple Plugin does not work.
You haven't specified what game, but if it's CS:GO: Steam ID's are reported in game as STEAM_1, not STEAM_0.
Try changing all of the steam ids to STEAM_1. EDIT: Also use OnClientPostAdminCheck |
Re: Simple Plugin does not work.
STEAM_0 is invalid, but a lot of games used it anyway... although the Valve games that did have all switched over to SteamId3 now as far as I can tell.
Out of curiosity, why aren't you just using admins and ban files for this? |
Re: Simple Plugin does not work.
Not sure if SM works this way, but it may be possible that once OnClientPostAdminCheck is called, it resets the player's admin flags to what they are in the config. So anything you do to the flags in OnClientAuthorized is ignored since OnClientPostAdminCheck comes after
|
Re: Simple Plugin does not work.
Quote:
|
Re: Simple Plugin does not work.
I'll reiterate that this should probably be done using admins.cfg / admins_simple.ini and the banid command.
Having said that, if you're changing admin permissions, you should be doing it in a OnClientPostAdminFilter which exists solely for this purpose. |
All times are GMT -4. The time now is 16:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.