Did you actually write this? Half the time you use ; to end the line and the other half of the time you don't. The indentation is different also and some of the code just doesn't do what it is supposed to do. This sounds more like a request for an entirely new plugin as it seems anyone replying to this would have to do surgery on it thus making it not even your code thus not your plugin thus you would not be able to put it off as your own which would then make it a request and not help.
BTW you can add passwords for people in users.ini which makes this pointless but Im going to post a plugin for you anyhow. give me a few mi nutes and I'll be done.
Edit: I just finished writing what it is you are trying to do. Enjoy.
Edit2: apparently someone actually used the code I posted and noticed a problem while using it so I have posted a revised version. Enjoy
Code:
/* AMXModX Script
*
* Title: Player Verification (amx_verify)
* Author: SubStream
*
* Current Version: 1.0
* Release Date: 2006-05-10
*
* For support on this plugin, please visit the following URL:
* Player Verification URL = <dont think im going to submit this you can use users.ini for this>
*
* Player Verification - If a player doesn't type amx_verify <password> they get kicked after 35
* seconds.
* Copyright (C) 2006 SubStream
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author Contact Email: <a href="mailto:[email protected]">[email protected]</a>
*/
#include <amxmodx>
#include <amxmisc>
new const gs_PLUGIN
[] = "Player Verification"
new const gs_VERSION
[] = "1.0"
new const gs_AUTHOR
[] = "SubStream"
new bool: gb_UserEnteredPassword
[33]
new gs_password
[32] = "password"
new gs_name
[32]
new gs_arg
[32]
new gi_userid
new gs_reason
[] = "You did not verify yourself."
public plugin_init
()
{
register_plugin ( gs_PLUGIN, gs_VERSION, gs_AUTHOR
)
register_concmd ( "amx_verify",
"fn_verify", ADMIN_CHAT,
"<password> - sends password to server." )
}
public client_putinserver
( id
)
{
gb_UserEnteredPassword
[id
] = false
set_task ( 35.0,
"fn_client_verification", id
)
}
public client_disconnect
( id
)
{
gb_UserEnteredPassword
[id
] = false
}
public fn_client_verification
( id
)
{
if ( ! is_user_connected ( id
) )
{
return PLUGIN_HANDLED
}
if ( gb_UserEnteredPassword
[id
] == true ) return PLUGIN_HANDLED
else
{
get_user_name ( id, gs_name,
31 )
gi_userid
= get_user_userid ( id
)
client_print ( 0, print_chat,
"*** %s was kicked from the server because they were not verified ***", gs_name
)
client_print ( id, print_console,
"*** You are being kicked because you did not verify yourself ***" )
server_cmd ( "kick #%i %s", gi_userid, gs_reason
)
}
return PLUGIN_CONTINUE
}
public fn_verify
( id, level, cid
)
{
if ( ! cmd_access ( id, level, cid,
2 ) ) return PLUGIN_HANDLED
if ( gb_UserEnteredPassword
[id
] == true ) client_print ( id, print_chat,
"You have already been verified." )
read_argv ( 1, gs_arg,
31 )
if ( equali ( gs_arg, gs_password
) )
{
gb_UserEnteredPassword
[id
] = true
client_print ( id, print_chat,
"You are now verified." )
remove_task ( id
)
}
else
{
gb_UserEnteredPassword
[id
] = false
client_print ( id, print_chat,
"Invalid password. You are not verified." )
}
return PLUGIN_CONTINUE
}