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

Custom Command Block v1.2


Post New Thread Reply   
 
Thread Tools Display Modes
TheArmagedon
Senior Member
Join Date: Sep 2010
Location: Unknown Source
Old 11-06-2011 , 14:46   Re: Custom Command Block v1.1
Reply With Quote #11

Plugin updated! V1.1 Released, check the main post for more information.
Thanks liinuus for the idea.

Last edited by TheArmagedon; 11-06-2011 at 14:46.
TheArmagedon is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-18-2011 , 20:16   Re: Custom Command Block v1.1
Reply With Quote #12

I first thought the plugin could dynamically block commands stored in a file...
Team blocker is not efficient because you only block jointeam so you miss old style menu way to pick up a team.
For me this plugin is useless, waiting for other approvers feeling before to unapprove it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
TheArmagedon
Senior Member
Join Date: Sep 2010
Location: Unknown Source
Old 11-20-2011 , 20:32   Re: Custom Command Block v1.1
Reply With Quote #13

My idea of creating a "Team Block" was that if you enabled the "Team Block" you could not even enter a team (in which case the jointeam prevents this).
And then you could change according to your choice, that is, if you put the "Team Block" only for the cts, so the person would play only with the Terrorists. And so you would use your creativity or even a different game mod.
Well, the plugin for some people can be useful, as I already said, you can use your creativity, and can also facilitate some mods ... an example: deathrun ...

Last edited by TheArmagedon; 11-20-2011 at 20:33.
TheArmagedon is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-21-2011 , 01:27   Re: Custom Command Block v1.1
Reply With Quote #14

Quote:
Originally Posted by TheArmagedon View Post
My idea of creating a "Team Block" was that if you enabled the "Team Block" you could not even enter a team (in which case the jointeam prevents this).
And then you could change according to your choice, that is, if you put the "Team Block" only for the cts, so the person would play only with the Terrorists. And so you would use your creativity or even a different game mod.
Well, the plugin for some people can be useful, as I already said, you can use your creativity, and can also facilitate some mods ... an example: deathrun ...
But plugin doesn't block team join via old style menus, only VGUI.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
TheArmagedon
Senior Member
Join Date: Sep 2010
Location: Unknown Source
Old 11-21-2011 , 08:55   Re: Custom Command Block v1.2
Reply With Quote #15

@Connor
fixed.
_
Updated v1.2 released

Last edited by TheArmagedon; 11-21-2011 at 08:56.
TheArmagedon is offline
feifei
Senior Member
Join Date: Sep 2014
Location: India
Old 12-16-2014 , 12:56   Re: Custom Command Block v1.2
Reply With Quote #16

confused with 2 things

RADIO = Block radio msg <-- you said radio message !!
KILL = Block kill <-- what is this ??

1. RADIO = Block radio msg
:> You can block only radio message, not radio voice.

2. KILL = Block kill
:> self kill, means suicide ??
__________________
MaTriX is my life
Visit Here ;) For ZP MODs

Last edited by feifei; 12-16-2014 at 12:57.
feifei is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-27-2014 , 07:20   Re: Custom Command Block v1.2
Reply With Quote #17

Don't know if you are still here but I want to say my opinion about your plugin. I think it's useless and not very well coded.

Not every function need to be public. Avoid it when it's not needed.
There are better ways for removing the buyzone like doing it in pfn_keyvalue forward(see next posts for explanations).
Why do you use another names for every variable you create in the if else if structure ? Just declare it above the if's and use the same one.
PHP Code:
joinB 0;
    
radioB 0;
    
killB 0;
    
sprayB 0;
    
buyB 0;
    
say_teamB 0;
    
sayB 0
No need to reset them since they are already 0 when initialized.
Try to keep all of your publics, forwards, natives in the order that they were registered/called.
In CheckBuy a switch will be better.

The way in which you arrange your code is a pain to read, really.

PHP Code:
if(cs_get_user_team(id) == CS_TEAM_CT && SAY == CT) {
            return 
PLUGIN_HANDLED_MAIN;
        } else if(
cs_get_user_team(id) == CS_TEAM_T && SAY == TR) {
            return 
PLUGIN_HANDLED_MAIN;
        } else if(
SAY == ALLTEAM) {
            return 
PLUGIN_HANDLED_MAIN;
        } 
This can be replaced by
PHP Code:
new Team cs_get_user_team(id)
    if
    (
        (
Team == CS_TEAM_CT && SAY == CT) ||
        (
Team == CS_TEAM_T && SAY == TR) ||
        (
SAY == ALLTEAM)
    )
    {
        return 
PLUGIN_HANDLED_MAIN
    

See, better to cache what cs_get_user_team return.
In SayBlockCMDT the same story.

In TeamBlockCMD you create the string new args[256]; but you have a define for max size. Use it...
Why do you read the arguments if you don't use them ? Also can be made as above.

In RadioBlockCMD, KillBlockC, FwdImpulse_201 same story.

Your way of reading the file is just "WOW". Firstly, use the new file natives which are more powerful. I'm not going to say anything about your "without-ending" if's and else if's nor that this can be done 100% better that how it's now.

This should be unnapproved.
__________________

Last edited by HamletEagle; 10-09-2015 at 12:49.
HamletEagle is online now
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-27-2014 , 10:49   Re: Custom Command Block v1.2
Reply With Quote #18

Quote:
ou use it may times, it would be better to make it constant.
It likely doesn't matter.

Quote:
There are better ways for removing the buyzone like doing it in pfn_keyvalue forward.
You should explain why it's better.
Current method is not that bad, but it disregards bombradius parameter which could be unwanted if a specific value is defined. Basically the logic needs to be improved. Ideally, this should check if such info_map_parameters exists, and if so, altering "buying" value. Something which could be achieved either by changing key value or setting directly m_iBuyingStatus offset. Considering you do that one time, I would simply check with find_ent_by_class, and if entity exists, I use the offset, otherwise, I create a new entity.
__________________
Arkshine is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-27-2014 , 11:50   Re: Custom Command Block v1.2
Reply With Quote #19

Even if not so important it's true and you know that.

About buyzone, it's better because: a map can already have an info_map_parameters entity witch custom radius.
Now he just remove the default entity and spawn another one depending on how the plugin is set( 3- no one, 1 - only ct 2 - only t) without taking care of dispatching bombradius key.

My suggestion was to create a custom one in precache( depending on the plugin setup ) and then, by using pfn_keyvalue you can check if the map already has an info_map_parameters entity. If so remove the one we created, otherwise you would screw up the radius.
After removing it you can use DispatchKeyValue with buying key and set the custom config on the default ent.
You avoid loosing the custom map radius, you don't use silly methods and you do what you want.
__________________
HamletEagle is online now
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-27-2014 , 12:25   Re: Custom Command Block v1.2
Reply With Quote #20

Quote:
Even if not so important it's true and you know that.
By definition a macro/define is already constant. If you mean creating a constant variable, it's still pointless for numerical value, but is useful for string if this one is repeated more than one time.

Quote:
About buyzone, it's better because: a map can already have an info_map_parameters entity witch custom radius.
Now he just remove the default entity and spawn another one depending on how the plugin is set( 3- no one, 1 - only ct 2 - only t) without taking care of dispatching bombradius key.
You basically repeats what I said...

Your suggestion is valid, but you do some unnecessary operations. pfn_keyvalue is a global forward and is going to be called for each entities setting a keyvalue. Considering you need to do that one time and at map loads, this forward is not really a good way for the context.
__________________
Arkshine 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 06:30.


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