Raised This Month: $12 Target: $400
 3% 

Add a flags update forward in 1.8.3


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-29-2017 , 08:38   Add a flags update forward in 1.8.3
Reply With Quote #1

Please, just do it. It's not hard to do. Making plugins for admin prefixes and stuff like that is pure death. You have to make multiple checks and functions in order to properly update the prefix when the flags change (on connect, on name change, etc) and you can't possibly detect all cases without editing other plugins.

PHP Code:
/* Called when the user's flags are changed. */
forward client_flags_updated(idiFlags); 
__________________

Last edited by OciXCrom; 12-29-2017 at 12:39.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 12-29-2017 , 09:14   Re: Add a flags update forward in 1.8.3
Reply With Quote #2

Can you show any idea how to make this forward just by describing it? Also for what iFlags stands?
__________________

Last edited by Relaxing; 12-29-2017 at 09:15.
Relaxing is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-29-2017 , 09:18   Re: Add a flags update forward in 1.8.3
Reply With Quote #3

What more descirption do you need than "called when the admin flags are updated"? It stand for the user's current flags.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 12-29-2017 , 13:51   Re: Add a flags update forward in 1.8.3
Reply With Quote #4

Quote:
Originally Posted by Relaxing View Post
how to make
__________________
Relaxing is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-29-2017 , 14:05   Re: Add a flags update forward in 1.8.3
Reply With Quote #5

Do you know what a forward is? Are you an AMXX developer? Probably no to both questions. Just leave this to the people who it's meant for.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 12-29-2017 , 18:04   Re: Add a flags update forward in 1.8.3
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
Do you know what a forward is? Are you an AMXX developer? Probably no to both questions. Just leave this to the people who it's meant for.
You submitted a suggestion that you cannot even describe by just using words. Pointless
__________________
Relaxing is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-29-2017 , 18:20   Re: Add a flags update forward in 1.8.3
Reply With Quote #7

He's actually described it enough to know exactly what he is requesting.
__________________
fysiks is offline
Old 12-29-2017, 22:14
CrazY.
This message has been deleted by CrazY.. Reason: No sense
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-30-2017 , 02:22   Re: Add a flags update forward in 1.8.3
Reply With Quote #8

The request is not directly related to the admin prefixes plugin. The requested feature is something that would be used inside of such a plugin for knowing when admin flags change.

So, the request is fully described in the code block (with two lines of code; one being a comment line) and the rest of his post is an explanation as to why he wants such a feature.
__________________

Last edited by fysiks; 12-30-2017 at 02:25.
fysiks is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-30-2017 , 08:26   Re: Add a flags update forward in 1.8.3
Reply With Quote #9

I can try doing this myself and submit a pull request, but I have no clue on how to compile the .cpp/.h files to get actual modules. Any quick tutorials? Is this going to work for the default AMXX files too?

amxmodx.cpp:
Code:
static cell AMX_NATIVE_CALL set_user_flags(AMX *amx, cell *params) /* 3 param */ {     int index = params[1];     if (index < 0 || index > gpGlobals->maxClients)     {         LogError(amx, AMX_ERR_NATIVE, "Invalid player id %d", index);         return 0;     }     CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);     int flag = params[2];     int id = params[3];     if (id < 0)         id = 0;     if (id > 31)         id = 31;     pPlayer->flags[id] |= flag;
    executeForwards(FF_ClientFlagsUpdated, static_cast<cell>(index), static_cast<cell>(flag), static_cast<flags[id]>(i));
    return 1; }

^ Don't kill me if what I wrote makes no sense.
__________________

Last edited by OciXCrom; 12-30-2017 at 08:28.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-30-2017 , 08:47   Re: Add a flags update forward in 1.8.3
Reply With Quote #10

Wouldn't hurt to try it yourself, it's a great experience.

Anyway if you are on Windows you would need either Visual Studio 2013+ or just C++ Build Tools (I don't know if this will work, but it should). You also need Git to download necessary stuff (you can do without it, but it will make it easier) and Python installed to run AMBuild.

Go to a directory where you want to download all this stuff and execute in order:
Code:
### First time setup ###

git clone https://github.com/alliedmodders/ambuild
python ambuild/setup.py install
git clone https://github.com/alliedmodders/hlsdk
git clone https://github.com/alliedmodders/metamod-hl1
git clone https://github.com/alliedmodders/amxmodx

### Build process ###

#Now vcvars32.bat may not be in your PATH env variable.
#It seems like it's usually under "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin" (May be other than 14.0 depending on VS version).
#You have to run it in THE CURRENT cmd.exe INSTANCE for it to set up some environment variables (like the path to your compiler).
vcvars32
mkdir amxmodx/obj-windows
cd amxmodx/obj-windows

#configure.py will throw an exception if the compiler isn't found (for example: vcvars32 not executed)
python ../configure.py --no-mysql

###Finally build
ambuild
If you want to contribute, before making any changes to the source tree first check if the build process works for you.
Now that you made sure it works, to make a contribution go to https://github.com/alliedmodders/amxmodx and click the "Fork" button.
Make sure your current working directory is where you cloned amxmodx and execute following commands to set remote repositories. This is a one-time setup.
Code:
git remote set-url origin https://github.com/<your GH username>/amxmodx
git remote add upstream https://github.com/alliedmodders/amxmodx
Now that you want to make a change do
Code:
git checkout master #Switch to the master branch
git pull upstream master #Update your master branch to match alliedmodders' one
git checkout -b admin-flags-forward #Create a new branch named admin-flags-forward and switch to it

### Make changes ###

#Check what files have been changed. You DON'T want to commit just any file, only the ones that really concern your update.
#For example opening the project in Visual Studio or some other IDE is known to change/add some files to the source tree.
#You don't want any temporary/backup files commited, only the ones you actually updated.
git status

#Add files that you want to commit, relative to the current working directory.
#If there are no files that you WOULDN'T want to commit you can just do "git add -a" to add all.
#For example if you changed "amxmodx/amxmodx.cpp", "amxmodx/meta_api.cpp" and "plugins/include/amxmodx.inc" you would execute
git add "amxmodx/amxmodx.cpp" "amxmodx/meta_api.cpp" "plugins/include/amxmodx.inc"

#Finally commit your update, together with a short, but descriptive message, and push it to your GitHub.
git commit -m "Add a flags update forward client_flags_updated"
git push origin admin-flags-forward
Now when you go to your "amxmodx" either on your or AlliedModders' account on GitHub a "Compare and Pull Request" button will pop up.
__________________

Last edited by klippy; 12-30-2017 at 09:09.
klippy is offline
Reply


Thread Tools
Display Modes

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 14:42.


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