Raised This Month: $ Target: $400
 0% 

Simple plugin not working


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
anssik
Senior Member
Join Date: May 2006
Location: Suomi Finland Perkele
Old 05-29-2007 , 08:20   Re: Simple plugin not working
Reply With Quote #3

This is actually a really good idea! I made some extra protection in it which should make it much more secure.
Code:
new g_oldpass[64] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("say", "check_say")    //check say this way     register_clcmd("say_team", "check_say")   //check say_team this way     register_clcmd("amx_maps", "cmdListMaps", -1, "Lists ALL available maps - * or blank for all otherwise <prefix> (eg: surf)")     get_cvar_string("rcon_password", g_oldpass, 63) } public check_say(id) {     new said[32]     new arg1[32]     new arg2[32]     read_args(said, 31)     remove_quotes(said)     strbreak(said, arg1, 31, arg2, 31)    //split string     //check if first arg. equals desired command     if (equali(arg1, "/maps") || equali(arg1, "maps"))           executeListMaps(id, arg2)    //send prefix or empty string as an arg. } public cmdListMaps(id) {     new arg1[17]     read_argv(1, arg1, 16)     executeListMaps(id, arg1) } public executeListMaps(id, param[]) {     new maps_cmd[33]     new prefix_to_send[16]         new arg1[17]     copy(arg1, 16, param)     set_cvar_string("rcon_password", "temporary")     if (!arg1[0])     {         format(prefix_to_send, 1, "*")         format(maps_cmd, 32, "maps %s", prefix_to_send)         client_cmd(id, "rcon_password temporary")         client_cmd(id, "rcon %s", maps_cmd)         client_cmd(id, "rcon_password empty")     }     else     {         remove_quotes(arg1)         copy(prefix_to_send, 16, arg1)         format(maps_cmd, 32, "maps %s", prefix_to_send)         client_cmd(id, "rcon_password temporary")         client_cmd(id, "rcon %s", maps_cmd)         client_cmd(id, "rcon_password empty")     }     set_cvar_string("rcon_password", g_oldpass)     return PLUGIN_HANDLED }
__________________
anssik is offline
 



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 10:37.


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