Raised This Month: $ Target: $400
 0% 

Solved Set player flags question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-18-2022 , 08:43   Re: Set player flags question
Reply With Quote #1

Quote:
Originally Posted by iceeedr View Post
I have a problem that is at least annoying, the flags are not being set in the players, tested on windows and linux.
1. After changing the player's name, the admin core plugin reloads his access: https://github.com/alliedmodders/amx....sma#L768-L781

2.
Code:
public setTag(id) {              /* Why do you remove the player's flags? */         remove_user_flags(id, -1)        new flags = get_user_flags(id), sflags[MAX_NAME_LENGTH]         get_flags(flags, sflags, charsmax(sflags))         log_amx("[1] My flags are now %s", sflags)         if(containi(g_szPlayerName[id], gCvars[VarClanPrefix]) != -1)         {                 replace(g_szPlayerName[id], charsmax(g_szPlayerName), gCvars[VarClanPrefix], "")                 set_user_info(id, "name", g_szPlayerName[id])                 set_user_flags(id, ADMIN_USER)         }         else         {                 new szFullName[MAX_NAME_LENGTH]                 formatex(szFullName, charsmax(szFullName), "%s %s", gCvars[VarClanPrefix], g_szPlayerName[id])                 copy(g_szPlayerName[id], charsmax(g_szPlayerName), szFullName)                 set_user_info(id, "name", szFullName)                 log_amx("[2] Read flags = %i", read_flags(gCvars[VarFlags]))                 set_user_flags(id, read_flags(gCvars[VarFlags]))                 log_amx("[3] Setting flags = %s", gCvars[VarFlags])         }         /* You still get the inital value of flags, you need to get them again */         flags = get_user_flags(id)         get_flags(flags, sflags, charsmax(sflags))         log_amx("[4] My flags are %s", sflags)         return PLUGIN_HANDLED }
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-18-2022 , 09:43   Re: Set player flags question
Reply With Quote #2

1 - I really didn't think about that case, I set a task and it's working.

2 - set_user_flags just adds the selected flags to the existing ones and I don't want ADMIN_USER so I remove them all before setting, problem solved.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
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 11:29.


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