Raised This Month: $ Target: $400
 0% 

Solved simple question - problem with setting pass with parm


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nacknic
Senior Member
Join Date: Mar 2019
Old 05-24-2021 , 10:33   simple question - problem with setting pass with parm
Reply With Quote #1

Code:
        set_pcvar_string(cvar_Pass, pass) //get pass from another program 
              .
              .
              .
	new spass[11]
	get_pcvar_string(cvar_Pass, spass, charsmax(spass))
        client_print(0, print_chat, "[AMX] pass = %s", spass) //print the right pass
        server_cmd("sv_password '%s'", trim(spass))
the pass not correct

Last edited by nacknic; 05-24-2021 at 12:42.
nacknic is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 05-24-2021 , 10:47   Re: simple question - problem with setting pass with parm
Reply With Quote #2

set sv_password with set_pcvar_string() not with server_cmd()
jimaway is offline
nacknic
Senior Member
Join Date: Mar 2019
Old 05-24-2021 , 12:28   Re: simple question - problem with setting pass with parm
Reply With Quote #3

thank this work for me :
Code:
#include <amxmodx>

new sv_password
public plugin_init() {
	sv_password = get_cvar_pointer("sv_password")
	register_clcmd("say !setpass", "set_pass")
}

public set_pass() {
         new sPassword[16] 
	sPassword = "123" 
	set_pcvar_string(sv_password, sPassword)
}

Last edited by nacknic; 05-24-2021 at 12:42.
nacknic 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 02:32.


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