Raised This Month: $ Target: $400
 0% 

cvar and set cvar value from concmd


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
lqlqlq
Senior Member
Join Date: Jan 2008
Old 07-05-2013 , 16:07   cvar and set cvar value from concmd
Reply With Quote #1

I try to adding a password to Temporary admin:

Code:
register_concmd("amx_tempadmin","amx_tempadmin",ADMIN_RCON," <NAME> <PASS> <Days to have admin (0=infinate)> <Flags(find out flags in users.ini file)> ")
cvar:
Code:
new password
password = register_cvar("password","0")
here is my trying:
Quote:
public amx_tempadmin(id,level,cid)
{
if ( !cmd_access(id,level,cid,4) )
{
return PLUGIN_HANDLED
}
new arg1[63]
new arg2[63]
new arg3[63] /*argv for password*/
new arg4[63]
read_argv(1,arg1,63)
read_argv(2,arg2,63)
read_argv(3,arg3,63) /*argv for password*/
read_argv(4,arg4,63)
set_cvar_string("flags",arg4)
new arg22 = str_to_num(arg2)
new plist[32]
new pnum
get_players(plist,pnum,"c")
new tempid2 = find_player("bl",arg1)
set_cvar_num("tempid",tempid2)
set_cvar_num("findays",arg22)

/*Here is need to define something, but i dont know what... */
set_cvar_num("password", goal)


new temp_connected = is_user_connected(tempid2)
if(temp_connected==1)
{
if(str_to_num(arg2)==0 || str_to_num(arg2)>=900)
{
new instertintousers[200]
new instertintousersname[200]
get_user_name(tempid2,tempname[tempid2],31)
new tempsauthid[32]
get_user_name(tempid2,tempsauthid,31)
format(instertintousers,199,"^"%s^" ^"%s^" ^"%s^" ^"a^"",tempsauthid,goal,arg4)
new configdir[200]

Last edited by lqlqlq; 07-05-2013 at 16:08.
lqlqlq 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 06:26.


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