Raised This Month: $ Target: $400
 0% 

Clan WArs plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
L3X.
Junior Member
Join Date: Nov 2006
Old 12-07-2006 , 00:15   Clan WArs plugin
Reply With Quote #1

This plugin for clan war servers.
Description:
This plugin will force non admins to input a password in the console when entering the server. They have a certain time to enter the password, and a certain number of tries. If the password is incorrect or they dont enter one, they will be kicked from the server.

CVAR's:
ppc_password <password> - this is the server password
ppc_checkpass 1 |0 - this is on or off
ppc_passtime 80 - this is the time they have to enter the password
ppc_passtrys 2 - this is the number of invalid tries

Commands:
ppc_adminpass - tells an admin the password

Client Commands:
ppc_password <password> - do that in console to enter the password Server not kick admins.

I need that I can type pass before enter server and server not kick if my pass good. Now I can type only in game.
For examble setinfo ppc_password "password"
But I can't connect "setinfo" function.. HELP. thx

Code:
#include <amxmodx> #include <amxmisc> new bool:passok[33] new passtry[33] public plugin_init() {     register_plugin("Pass Checker", "0.1", "PeteyB")     register_cvar("ppc_password", "password") //this is your password feild     register_cvar("ppc_checkpass", "1")  //this is on or off     register_cvar("ppc_passtime", "80")  //this is the time to say password     register_cvar("ppc_passtrys", "2")   //this is the number of trys allowed     register_clcmd("ppc_adminpass", "admintellpass") //admins use this to see password     register_clcmd("ppc_password", "check_pass") } public admintellpass(id) {     if(get_user_flags(id) & ADMIN_LEVEL_C)     {         new tpassword[40]         get_cvar_string("ppc_password", tpassword, 39)         console_print(id, "PPC Password: %s   - To change: Change the cvar ppc_password", tpassword)     }     else         console_print(id, "Must be admin to check the PPC password")    } public client_putinserver(id) {     if(get_cvar_num("ppc_checkpass") && !(get_user_flags(id) & ADMIN_LEVEL_C))     {         passtry[id] = 0         passok[id] = false         set_task(float(get_cvar_num("ppc_passtime")), "nopass", id)         set_task(10.0, "tellpass", id)     }   } public nopass(id) { if(access(id,ADMIN_KICK))                {                   client_print(id,print_chat,"[ADMIN] No Kick For You")                }                else {     if(get_cvar_num("ppc_checkpass") && passok[id] == false)         client_cmd(id, "echo [PPC]You did not enter a password;disconnect") }     } public tellpass(id) { if(access(id,ADMIN_KICK))                {                   console_print(id,"[ADMIN] No Kick")                }                else {     if(passok[id] == false)     {         client_print(id, print_center, "[PPC]In console type: ppc_password <the server password>")         set_task(10.0, "tellpass", id)     } }         } public check_pass(id) {     new password[40]     read_args(password, 39)     new ppcpass[40]     get_cvar_string("ppc_password", ppcpass,39)         if(equal(password,ppcpass))     {         passtry[id] = 0         console_print(id,"[PPC]Correct Password")         passok[id] = true     }     else     {         passtry[id] += 1         console_print(id,"[PPC]Incorect Password - Try Again")         passok[id] = false     }         if(passtry[id] == get_cvar_num("ppc_passtrys"))         client_cmd( id,"echo [PPC]Too many invalid attempts;disconnect") }

Last edited by L3X.; 12-07-2006 at 00:17.
L3X. is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 12-07-2006 , 00:57   Re: Clan WArs plugin
Reply With Quote #2

I'm not sure if you will have conflicts by having several things with the same name, test it and see.

Code:
public client_putinserver(id) {     if(get_cvar_num("ppc_checkpass") && !(get_user_flags(id) & ADMIN_LEVEL_C))     {         passtry[id] = 0         passok[id] = false         set_task(float(get_cvar_num("ppc_passtime")), "nopass", id)         set_task(10.0, "tellpass", id)     }           new tpassword[40], user_pass[40]         get_cvar_string("ppc_password", tpassword, 39)     get_user_info(id, "ppc_password", user_pass, 39)         if(equal(tpassword, user_pass)) passok[id] = true }
stupok is offline
L3X.
Junior Member
Join Date: Nov 2006
Old 12-07-2006 , 11:23   Re: Clan WArs plugin
Reply With Quote #3

Quote:
Originally Posted by stupok69 View Post
I'm not sure if you will have conflicts by having several things with the same name, test it and see.

Code:
public client_putinserver(id) {     if(get_cvar_num("ppc_checkpass") && !(get_user_flags(id) & ADMIN_LEVEL_C))     {         passtry[id] = 0         passok[id] = false         set_task(float(get_cvar_num("ppc_passtime")), "nopass", id)         set_task(10.0, "tellpass", id)     }           new tpassword[40], user_pass[40]         get_cvar_string("ppc_password", tpassword, 39)     get_user_info(id, "ppc_password", user_pass, 39)         if(equal(tpassword, user_pass)) passok[id] = true }
Not work.
Now server nobody kick

Last edited by L3X.; 12-07-2006 at 22:04.
L3X. is offline
L3X.
Junior Member
Join Date: Nov 2006
Old 12-08-2006 , 05:31   Re: Clan WArs plugin
Reply With Quote #4

I do not trust that nobody knows as to correct a code of the program I think that here need function get_user_info but as it to insert and how correctly to use I do not know.
L3X. is offline
L3X.
Junior Member
Join Date: Nov 2006
Old 12-09-2006 , 06:44   Re: Clan WArs plugin
Reply With Quote #5

How I can do that admin set password not in cvar as
register_cvar("ppc_password", "password")

I need do that a simple command
register_clcmd("ppc_password", "password")

public password(id)

............... what I need type here? Need help
maybe
new tpassword[40]
set_cvar_string("ppc_password", tpassword, 39)
............
L3X. 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 06:51.


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