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

[DOD:s]fix [DoDS] Class Restrictions for individual players..


Post New Thread Reply   
 
Thread Tools Display Modes
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-22-2022 , 11:47   Re: [DOD:s]fix [DoDS] Class Restrictions for individual players..
Reply With Quote #11

I drop unfinished test plugin here, you can try if you like.

- There is no menu and KeyValue file in use.
- There is test command "sm_testclass", you ban yourself sniper class in both teams.
When player disconnect ban is removed.


This use DHooks. So I have only tested on Windows, but I included Linux signatures hope those work.

*edit
About that original plugin what you posted #1, I think you just need disable random class (mp_allowrandomclass 0)
Becuase it is one class like others, but player get different class on each respawn, it bypass joinclass command.
Attached Files
File Type: zip earlyaccess_test_dod.zip (16.2 KB, 45 views)
__________________
Do not Private Message @me

Last edited by Bacardi; 12-22-2022 at 11:50.
Bacardi is offline
mewbie222
Senior Member
Join Date: May 2018
Old 12-23-2022 , 01:00   Re: [DOD:s]fix [DoDS] Class Restrictions for individual players..
Reply With Quote #12

Bacardi thanks ,I'll test today and tell you ..
Quote:
This use DHooks.
And without it, DHooks, it's impossible, otherwise it's reluctant to put extra extensions.
By the way this https://github.com/peace-maker/DHooks2 will work?

Quote:
(mp_allowrandomclass 0)
As you wrote, I set it to "0" .. By the way, thanks for the advice ..

Last edited by mewbie222; 12-23-2022 at 01:17.
mewbie222 is offline
mewbie222
Senior Member
Join Date: May 2018
Old 12-23-2022 , 01:14   Re: [DOD:s]fix [DoDS] Class Restrictions for individual players..
Reply With Quote #13

not for me the error immediately gives
Quote:
87 <Bad Load> earlyaccess_test.smx
Errors:
earlyaccess_test.smx: Unable to load plugin (unsupported feature set; code is too new)
And the extension doesn't want to work either.
+++
Quote:
Yes, in DODS, there is such a DoDNooks https://forums.alliedmods.net/showth...57#post2781857 .. so far it works under sm 1.10 .. and it seems to be higher on sm 1.11 too. checked..
Maybe there is something interesting there.
P.s. All the same, I would like to make a plugin, without any additives in the form of extensions .. This is just my opinion .. Otherwise, everyone forgot about DODs%)))
Yes, I forgot to write, I have this with the server (technical server info): https://prnt.sc/44aWykSuBCNO
add
Quote:
Also, server can send to client ConVar value (mp_limit_axis_rifleman 0). This will show on client screen in class menu that class is full/limited, but it not prevent player to choose it though.
By the way, this has become interesting to me, as I understand it, just to transfer it, through FakeClientCommand?
Something like this, Right ?:
Quote:
FakeClientCommand(client, "mp_limit_axis_%s 0;mp_limit_allies_%s 0", classstring, classstring);

Last edited by mewbie222; 12-23-2022 at 01:49.
mewbie222 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-23-2022 , 03:42   Re: [DOD:s]fix [DoDS] Class Restrictions for individual players..
Reply With Quote #14

...are you still running SM 1.10?
Is there problem with latest SM stable version 1.11 ?
__________________
Do not Private Message @me
Bacardi is offline
mewbie222
Senior Member
Join Date: May 2018
Old 12-23-2022 , 04:01   Re: [DOD:s]fix [DoDS] Class Restrictions for individual players..
Reply With Quote #15

Quote:
Originally Posted by Bacardi View Post
...are you still running SM 1.10?
Is there problem with latest SM stable version 1.11 ?
Yes... Sorry ..

DODs and plugins for it are so old that with each update, and even more so those who use the same DODHooks, for example, you have to solve it. And this is also not an easy task for me, for example.
Either one plugin stops working, then another .. in general, horror with these updates and SM ...
Although someone put 1.11 in a compartment with DODHooks, everything seems to work.
But I don’t want to update the SM yet, unless of course they update the hosting, then I will have to .. And so I would not want to update the SM to 1.11 ..

Last edited by mewbie222; 12-23-2022 at 04:02.
mewbie222 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-23-2022 , 04:38   Re: [DOD:s]fix [DoDS] Class Restrictions for individual players..
Reply With Quote #16

Not sure, could you pick dhooks from SM zip and use in 1.10.

There is earlier version of dhooks, but not sure do it have natives what plugin use.

I gonna test that...
__________________
Do not Private Message @me
Bacardi is offline
mewbie222
Senior Member
Join Date: May 2018
Old 12-23-2022 , 05:09   Re: [DOD:s]fix [DoDS] Class Restrictions for individual players..
Reply With Quote #17

Quote:
Originally Posted by Bacardi View Post
Not sure, could you pick dhooks from SM zip and use in 1.10.
I used this DHook, but as I understand it, you have a plugin under SM 1.11, because of this your plugin did not work ... As for the extension, it seems to work. the version indicated below https://github.com/peace-maker/DHook...rs17-sm110.zip ..
---
about dhooks and in DODHook, there are different extensions. the first one was written specifically for the game DODs (link): https://forums.alliedmods.net/showthread.php?t=271653
This is so that you do not get confused, what I meant about SM updates and dodshooks extensions thr https://forums.alliedmods.net/showpo...1&postcount=15...
Thanks again for your help..

P.s. Now I'll try later to add the plugin to the original(https://forums.alliedmods.net/showthread.php?t=81610) or change the check a bit, etc....
====
add
that's disgusting, I decided to copy your plugin under SM 1.10, but this is what it writes during the compilation: https://prnt.sc/bY-qbDoVsrZG ..I thought that the code under SM 1.10 and 1.11 is not much different ...
Sorry, it didn't work, my idea...

Last edited by mewbie222; 12-23-2022 at 06:41.
mewbie222 is offline
mewbie222
Senior Member
Join Date: May 2018
Old 12-23-2022 , 10:58   Re: [DOD:s]fix [DoDS] Class Restrictions for individual players..
Reply With Quote #18

I decided to do it like this for now, check how it will be, but it confused me at the end return Plugin_Continue , whether there will be an error again ...
PHP Code:
    HookEvent("player_changeclass"ChangeClassEvent////   removed EventHookMode_Pre
....
public 
Action:ChangeClassEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (
GetConVarInt(g_Cvar_Enable))
    {
        new 
client GetClientOfUserId(GetEventInt(event"userid"))
        new class  = 
GetEventInt(event"class")
    
//    new String:classstring[64]
        
        
if (g_Class[client][class] == 1)
        {
            
PrintCenterText(client"%s Class Unavailable"classname[class])
            return 
Plugin_Handled
            
//Format(classstring, sizeof(classstring), "joinclass %i", g_PreviousClass[client])
            //FakeClientCommand(client, classstring)
            //new team   = GetClientTeam(client)
            //ShowVGUIPanel(client, team == 3 ? "class_ger" : "class_us")
        
}
        else
        {
            
g_PreviousClass[client] = class
        }
    }
    return 
Plugin_Continue

I tried the code above, they said they take the blocked class without problems .. In General, you need to think, otherwise I want to finish the old code ...

add
PHP Code:
        else
        {
            
g_PreviousClass[client] = class
        } 
By the way, I don’t like this piece of code, because as I was told, the lock on the blocked class works 1 time, and 2 times they take the blocked class without problems ..
That is, they chose a blocked class, the blocking worked for them, then, if I understood correctly, the blocked class became the previous one, and they can easily choose this class ..
Well, as I understand it, I can be wrong .. Maybe this is the whole problem?!!!

Last edited by mewbie222; 12-25-2022 at 03:51.
mewbie222 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-26-2022 , 10:18   Re: [DOD:s]fix [DoDS] Class Restrictions for individual players..
Reply With Quote #19

Maybe. Did you try disable random class what I have mention two times ?

Anyway... here is crab what I have done so far.


- This work only on SourceMod 1.11 (and later)

- No commands, no cvars

- Plugin save KeyValue file in ...sourcemod/data/plugin.classrestriction.txt
It store bit value, so you can not really edit if you not know correct bits.
And plugin need to be unload before edit anything.



I tried to change plugin to work SM 1.10 with dhooks-2.2.0-detours17-sm110-1,
but then plugin start crash server everytime.
I don't have time to look that problem.
And why we should stick to support older version of SM anyway...

Also Weapon restriction (SDKHooks) not included. Maybe this need to be separate plugin rather than include all in one plugin...
Look that later when have free time.
Attached Files
File Type: zip dodsclassrestriction.zip (20.7 KB, 40 views)
__________________
Do not Private Message @me

Last edited by Bacardi; 12-26-2022 at 10:19.
Bacardi is offline
mewbie222
Senior Member
Join Date: May 2018
Old 12-26-2022 , 11:46   Re: [DOD:s]fix [DoDS] Class Restrictions for individual players..
Reply With Quote #20

Quote:
Did you try disable random class what I have mention two times ?
As you suggested, I changed this line to the server.cfg as you wrote --> mp_allowrandomclass 0...

---

Thanks, I'll try, maybe I'll try on the old Dhooks even older .. but I don't know .. will it work or not ...
It's a pity that for see 1.11, no matter how other plugins "fell off in work" ..
I'll try updating to sm 1.11.
Thanks again.

Last edited by mewbie222; 12-27-2022 at 02:29.
mewbie222 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 17:35.


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