Raised This Month: $32 Target: $400
 8% 

Help with "kick reasons"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 05-23-2010 , 02:10   Help with "kick reasons"
Reply With Quote #1

PHP Code:
new Names[][] = { "p1""p2""p3","p4""p5" }

new 
Reasons[][] = { "r1""r2" "r3""r4""r5" }

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_connectid )
{
    new 
name32 ], i
    get_user_name
id name 31)
    
    for (
0sizeof(Names); i++)
    {
        if (
equali(nameNames[i]))
        {
            
//for (i = 0; i < sizeof(Reasons); i++)
                
server_cmd("kick #%s ^"%s^""Names[i], Reasons[i])
        }
    }

I don't care if it's by name or steamid, it doesnt work. The purpose of this plugin is to add names, and if the server detects that name it will kick the client, and send the kick reason. Of course, the kick reason will not be the same por user 2, 3, 4, and 5.

How can i make it work?
AfteR. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-23-2010 , 16:48   Re: Help with "kick reasons"
Reply With Quote #2

Code:
server_cmd("kick #%d ^"%s^"", get_user_userid(id), Reason[i])
I would also recommend (if you plan on keeping this method of inputing names and reasons)

Code:
new Reasons[sizeof(Names)][] = { "r1", "r2" , "r3", "r4", "r5" }
Not required but will prevent runtime errors (errors will appear at compile time ) with Reasons[i].
__________________
fysiks is offline
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 05-24-2010 , 20:24   Re: Help with "kick reasons"
Reply With Quote #3

Thanks, I'll try

p.d: Any other sugestions?
AfteR. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-24-2010 , 20:34   Re: Help with "kick reasons"
Reply With Quote #4

Quote:
Originally Posted by AfteR. View Post
p.d: Any other sugestions?
If you use SteamIDs use Tries to replace the for() loop.
__________________
fysiks 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 04:56.


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