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

VAC Ban Status


Post New Thread Reply   
 
Thread Tools Display Modes
Spock
Member
Join Date: May 2007
Old 02-03-2009 , 11:44   Re: VAC Ban Status
Reply With Quote #31

Like this
Attached Thumbnails
Click image for larger version

Name:	bann.JPG
Views:	271
Size:	53.3 KB
ID:	36629  
Spock is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-03-2009 , 11:49   Re: VAC Ban Status
Reply With Quote #32

It only uses steam-id. I personally do not use amx bans so I do not know the correct format. Someone posted the below line in my aimbot detector plugin. What is the proper format?

PHP Code:
server_cmd"amx_ban ^"0^" ^"%s^" ^"VAC Ban Found^"" g_szAuthID[idCheck]); 
__________________
Bugsy is offline
diamond-optic
Veteran Member
Join Date: May 2005
Old 02-03-2009 , 17:54   Re: VAC Ban Status
Reply With Quote #33

default amxx: amx_ban client time reason
default amxbans: amx_ban time client reason

and i believe getting the unknown_STEAMID on the amxbans name/ip happens when the ban is added before a client has connected or after they have disconnected
__________________

Last edited by diamond-optic; 02-03-2009 at 17:57.
diamond-optic is offline
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 02-05-2009 , 06:50   Re: VAC Ban Status
Reply With Quote #34

PHP Code:
server_cmd"amx_ban 0 %s VAC Ban Found",g_szAuthID[idCheck]); 
should do it with amxbans.

btw, good plugin idea, will try it +karma
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 02-05-2009 , 11:12   Re: VAC Ban Status
Reply With Quote #35

Maybe a MultiLangual?

You got pretty much client_prints...
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-05-2009 , 11:58   Re: VAC Ban Status
Reply With Quote #36

I can do multilingual. I will put together the english lang and post it so people can translate.
__________________
Bugsy is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-05-2009 , 22:52   Re: VAC Ban Status
Reply With Quote #37

There are a few mistakes and optimizations that can be made, however it is acceptable.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-06-2009 , 00:15   Re: VAC Ban Status
Reply With Quote #38

Quote:
Originally Posted by Hawk552 View Post
There are a few mistakes and optimizations that can be made, however it is acceptable.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
Thanks for the approval. I always welcome criticism and advice.
__________________
Bugsy is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-06-2009 , 10:31   Re: VAC Ban Status
Reply With Quote #39

I assume that means you're asking me for advice on what to change.

Code:
new szHUD[479];

Make this static, as it is called relatively frequently.

Code:
                switch( PUNISHMETHOD )                 {                     case SHOOTBLANKS:                     {                         if( g_PutInServer[id] )                             set_user_hitzones( id , 0 , 0 );                                         g_ShootsBlanks[id] = 1;                     }                 }

This is strange and unless you're planning on adding more cases you should use a conditional (if) statement.

Code:
                new param[1];                 param[0] = id;                 set_task( 10.0 , "NotifyAdmin" , _ , param , 1 );

This is unnecessary redirection. Simply pass "id" into the task_id parameter.

Code:
g_PutInServer[id] = 1;

Although this is technically a mild optimization, it's probably better to just use is_user_connected() whenever you need it.

Code:
if( is_user_admin(id) && (get_user_flags(id) & ADMIN_BAN) )

This is redundant. If they have the ban flag, they must be an admin, so remove the is_user_admin() call.

Code:
public NotifyAdmin(param[1])

Unnecessary redirection. Just use something like this:

Code:
public NotifyAdmin(id)

Even if you choose not to take my earlier suggestion on the set_task() call, the memory layout is the same, so changing it to this would remove unnecessary redirection.

Code:
new szNames[513];

You might consider making a global "cache" variable which is 513 cells wide. You could then use this for the previous problem where I stated you should use the "static" operator.

Code:
    for( new i = 1; i <= g_MaxPlayers; i++ )     {         if( is_user_connected(i) && g_VACBanned[i] )         {             iFound++;             get_user_name( i , szName , 32 );             format( szNames , 512 , "%s%s^n" , szNames , szName );         }     }

Bad form. Use get_players().

Code:
    if( iFound )     {         set_hudmessage(255, 0, 0, 0.10, 0.55, 0, 6.0, 6.0, 0.5, 0.15, 3);         show_hudmessage(id, szNames);         client_cmd(id,"spk buttons/blip1.wav");     }

Bad form and unnecessary memory usage. Simply move this into the condition inside the for loop, then run break/return at the end. You're also using iFound as bool and since tags are meaningless you may consider renaming it to bFound if you choose not to take this suggestion.

Code:
new szPacket[512];

Use the global cache variable.

Code:
        if( iRequestType  )             console_print(id , "* [VAC Ban Status] Error loading socket");

Inconsistent styling. Use brackets or don't.

Code:
message_begin(MSG_ONE, 2 , {0,0,0}, target);

Don't use static variables for messages. Also, consider using MSG_ONE_UNRELIABLE. Also, you can replace {0,0,0} with _.

Code:
char_to_num(chNum) {     new iNum;     switch(chNum)     {         case '0':        iNum = 0;         case '1':        iNum = 1;         case '2':        iNum = 2;         case '3':        iNum = 3;         case '4':        iNum = 4;         case '5':        iNum = 5;         case '6':        iNum = 6;         case '7':        iNum = 7;         case '8':        iNum = 8;         case '9':        iNum = 9;     }         return iNum; } num_to_char(iNum) {     new chNum;     switch(iNum)     {         case 0:        chNum = '0';         case 1:        chNum = '1';         case 2:        chNum = '2';         case 3:        chNum = '3';         case 4:        chNum = '4';         case 5:        chNum = '5';         case 6:        chNum = '6';         case 7:        chNum = '7';         case 8:        chNum = '8';         case 9:        chNum = '9';     }         return chNum; }

These can be optimized by using '0' and 0 as basepoints and simply adding/subtracting.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-06-2009 , 11:19   Re: VAC Ban Status
Reply With Quote #40

Thanks for the help

Quote:
Originally Posted by Hawk552 View Post
Code:
                switch( PUNISHMETHOD )                 {                     case SHOOTBLANKS:                     {                         if( g_PutInServer[id] )                             set_user_hitzones( id , 0 , 0 );                                         g_ShootsBlanks[id] = 1;                     }                 }

This is strange and unless you're planning on adding more cases you should use a conditional (if) statement.
I used a switch because I am using a const to define the selected punishment. If I use an if-statement I get a compiler warning.

Quote:
Originally Posted by Hawk552 View Post
Code:
                new param[1];                 param[0] = id;                 set_task( 10.0 , "NotifyAdmin" , _ , param , 1 );

This is unnecessary redirection. Simply pass "id" into the task_id parameter.
I guess I don't understand set_task 100% then. I thought task_id always specifies the task_id used as a handle of the task (which can later be used for remove_task, task_exists later on). Are you saying if I pass a player_id to it the function passed will receive it? What if I want to specify a task_id as well?

Quote:
Originally Posted by Hawk552 View Post
Code:
    if( iFound )     {         set_hudmessage(255, 0, 0, 0.10, 0.55, 0, 6.0, 6.0, 0.5, 0.15, 3);         show_hudmessage(id, szNames);         client_cmd(id,"spk buttons/blip1.wav");     }

Bad form and unnecessary memory usage. Simply move this into the condition inside the for loop, then run break/return at the end. You're also using iFound as bool and since tags are meaningless you may consider renaming it to bFound if you choose not to take this suggestion.
That code is making a list of banned players so it waits until all players are checked before displaying the HUD msg. If I put it inside the loop it will display the first name found only and be done, which is not what I want.

Quote:
Originally Posted by Hawk552 View Post
Code:
        if( iRequestType  )             console_print(id , "* [VAC Ban Status] Error loading socket");

Inconsistent styling. Use brackets or don't.
I do try to always use brackets if one portion of a statement uses them, like if I use them for an 'if', I will also in 'else.' When the statement is only 1 line, I tend to leave out the brackets. I've seen this done in many scripts I have looked at so I figured it was accepted.
__________________
Bugsy 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 13:29.


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