AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Some problem with code (https://forums.alliedmods.net/showthread.php?t=48344)

L3X. 12-10-2006 07:37

Some problem with code
 
I have plugin that set password in cvar but I need simple command not in cvar.

Code:
register_clcmd("amx_set", "setcwpass")// this is set cw password register_cvar("admin_set_cw", "password") //this is your password feild public setcwpass(id) {     if(get_user_flags(id) & ADMIN_LEVEL_C)     {        *set_cvar_string("admin_set_cw","")  *  }     else  *console_print(id, "Must be admin to change the CW password")      }
But in game it write that no command how I can do it?
I need change cvar string simple command amx_set pass
not cvar. That amx_set chang string in admin_set_cw ">this<"

mateo10 12-10-2006 08:18

Re: Some problem with code
 
Code:
public setcwpass(id) {     new Arg[32]     read_argv(2, Arg, 31)     if(get_user_flags(id) & ADMIN_LEVEL_C)     {         set_cvar_string("admin_set_cw", Arg)     } else {         console_print(id, "Must be an admin to change the CW password")     } }
Tell me if it works or not :)

L3X. 12-10-2006 10:35

Re: Some problem with code
 
Not work...

How I can stop plugin code and begin new in one plugin?

Zenith77 12-10-2006 10:42

Re: Some problem with code
 
Why does it not work? Does it give you an error message, does it not change the cvar, etc?

jim_yang 12-10-2006 11:09

Re: Some problem with code
 
should be
read_argv(1, arg, 31)

stupok 12-10-2006 14:18

Re: Some problem with code
 
1 Attachment(s)
I tried to fix your plugin, please test it and tell me the results.

mateo10 12-10-2006 16:38

Re: Some problem with code
 
1 Attachment(s)
@ jim thought the command was the first. My bad.
@ stupok69 this is totally another plugin...

Here is a short short plugin that compiles fine.


All times are GMT -4. The time now is 06:58.

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