Raised This Month: $ Target: $400
 0% 

Help variable for determinate player´s


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BloodyNuker
Member
Join Date: Jan 2006
Old 04-25-2006 , 16:09   Help variable for determinate player´s
Reply With Quote #1

If i use variables for example
new password[32]="7"
this affect all players

How can i use a variable for determinate player ?

I need this because i do this plugin...


The plugin when a player connect, show if this put in console amx_jojo 7

If the player put amx_jojo in 7 the server do nothing, but if the player don´t put nothing in 35 seconds the server kick player

This is the plugin

Code:
#include <amxmodx> #include <amxmisc> new Plugin_Author[] = "Super kuak xD"; new Plugin_Version[] = "V 100.0"; new Plugin_Name[] = "Plugin" new password1[32]="no" new password2[32]="si" #define MAX_CLR 10 public plugin_init() { register_concmd("amx_jojo","cmdChat",ADMIN_CHAT,"<password> - sends password to server") register_plugin(Plugin_Name,Plugin_Version,Plugin_Author); } public client_putinserver(id) { set_task(35.0, "client_verification", id, "b") } public client_verification(id) { if( !is_user_connected(id) ) { return PLUGIN_HANDLED; } new name[32]; get_user_name( id , name , 31 ); if( equali(password1,password2) ) { client_print(id,print_chat,"*** It´s all right ***") } else { client_print(0,print_chat,"*** %s kicked from the server ***",name) client_cmd(id,"toggleconsole") client_cmd(id,"echo ^"*** Bye... see you!... ***^";disconnect") } return PLUGIN_CONTINUE } public cmdChat(id,level,cid) { if (!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED new message[192] read_args(message,191) if( equali(message,password2) ) { copy(password1, 31, "si") } return PLUGIN_HANDLED }


Tnkz!
BloodyNuker is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 05-10-2006 , 10:40  
Reply With Quote #2

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 }

Last edited by SubStream; 08-20-2006 at 08:05.
SubStream 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 05:11.


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