Raised This Month: $ Target: $400
 0% 

Change server pass...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Qlim4X
Member
Join Date: Jun 2007
Old 07-11-2007 , 00:20   Change server pass...
Reply With Quote #1

hi again

i want to make a script that can change the server password adn only other admins can see the pass and not the users

my admins dont have rcon access so they use amx_cvar sv_password and all the players can see the pass

so i need to creat a script that can change the pass just typing in the console pro_pass mypass
any ideas????

thx

this is my try but have problem when press to time the same password
Quote:
/* AMXMOD X script.
*
* (c) Copyright 2007 Qlim4X
* This file is provided as is (no warranties).
*
* For #Pro.Gather in GrNet. Internal use only.
*
*/
#include <amxmod>
#include <amxmisc>

public plugin_init()
{
register_plugin("pro.gather ChangePass","1.0","qlim4x")
register_concmd("pro_pass","set_password",ADM IN_BAN,"<password>")
register_cvar("sm_password","scrim",FCVAR_ARC HIVE|FCVAR_PROTECTED)
return PLUGIN_CONTINUE
}


public set_password(id, level, cid)
{
if(!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new set_pass[32]
read_argv ( id, set_pass, 31 )
set_cvar_string ( "sv_password", set_pass )
return PLUGIN_HANDLED
}

Last edited by Qlim4X; 07-11-2007 at 04:07.
Qlim4X is offline
Qlim4X
Member
Join Date: Jun 2007
Old 07-11-2007 , 04:09   Re: Change server pass...
Reply With Quote #2

i thing that i have fineshed


no how can i send a msg with the pass to all the admins in the server
Qlim4X is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 07-11-2007 , 07:42   Re: Change server pass...
Reply With Quote #3

is_user_admin
client_print or amx_chat (team_say @)
get_cvar_string

Last edited by [X]-RayCat; 07-11-2007 at 07:48.
[X]-RayCat is offline
Qlim4X
Member
Join Date: Jun 2007
Old 07-11-2007 , 13:08   Re: Change server pass...
Reply With Quote #4

Quote:
Originally Posted by [X]-RayCat View Post
is_user_admin
client_print or amx_chat (team_say @)
get_cvar_string

help me pliz where and how i can put this code...
Qlim4X is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-11-2007 , 16:34   Re: Change server pass...
Reply With Quote #5

This should do it:

Code:
/* AMXMOD X script.
*
* (c) Copyright 2007 Qlim4X
* This file is provided as is (no warranties).
*
* For #Pro.Gather in GrNet. Internal use only.
*
*/

#include <amxmod>
#include <amxmisc>

#define MAX_PLAYERS 32

public plugin_init()
{
	register_plugin("pro.gather ChangePass", "1.0", "qlim4x")
	
	register_concmd("pro_pass", "set_password", ADMIN_BAN, "<password>")
	
	register_cvar("sm_password", "scrim", FCVAR_ARCHIVE|FCVAR_PROTECTED)
}


public set_password(id, level, cid)
{
	if(!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED
	
	new set_pass[32]
	read_argv(1, set_pass, 31)
	
	set_cvar_string("sv_password", set_pass )
	server_exec()
	
	for(new i = 1; i <= MAX_PLAYERS; i++)
	{
		if(is_user_admin(id))
		{
			client_print(id, print_chat, "* sv_password changed to ^"%s^"", set_pass)
		}
	}
	
	return PLUGIN_HANDLED
}
stupok is offline
Qlim4X
Member
Join Date: Jun 2007
Old 07-11-2007 , 17:31   Re: Change server pass...
Reply With Quote #6

thx for the help

but if i can use the client_print with team_say @ new pass is + set_pass

it would be more easy.....

what u thing??? it is possible???


ps1)client_print(id, print_chat, "* sv_password changed to ^"%s^"", set_pass)
print_chat to team_say @

ps2)how can i check if the set_pass is not null??? if it is null i want to change the pass to progather else the given in the args

Last edited by Qlim4X; 07-11-2007 at 18:38.
Qlim4X is offline
Qlim4X
Member
Join Date: Jun 2007
Old 07-11-2007 , 22:08   Re: Change server pass...
Reply With Quote #7

again h change the code....


i can understand.... in the first 5-10 tries the script is working perfectly but after while the scripot doesnt work...

why??? what i do wrong???

Quote:
/* AMXMOD X script.
*
* (c) Copyright 2007 Qlim4X
* This file is provided as is (no warranties).
*
* For #Pro.Gather in GrNet. Internal use only.
*
*/
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
register_plugin("pro.gather ChangePass","1.0","qlim4x")
register_concmd("pro_pass","set_password",ADM IN_BAN,"<password>")
return PLUGIN_CONTINUE
}


public set_password(id, level, cid)
{
if(!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new set_pass[32]
read_argv ( id, set_pass, 31 )
set_cvar_string ( "sv_password", set_pass )
return PLUGIN_HANDLED
}

Qlim4X is offline
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 07-11-2007 , 22:39   Re: Change server pass...
Reply With Quote #8

you should set
Code:
server_exec()
after
Code:
 
set_cvar_string("sv_password", set_pass)
wrong:
Code:
read_argv ( id, set_pass, 31 )
should be
Code:
read_argv ( 1, set_pass, 31 )
1 means: read the first argument after your command (0 would return your command)

Quote:
Originally Posted by Qlim4X
but if i can use the client_print with team_say @ new pass is + set_pass
not really understand...
you want to use the command with team_say? maybe with "say /pro_pass password"?
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.

Last edited by |PJ| Shorty; 07-11-2007 at 22:45.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
stupok
Veteran Member
Join Date: Feb 2006
Old 07-12-2007 , 00:14   Re: Change server pass...
Reply With Quote #9

It doesn't seem like you looked at what I wrote for you.

This does exactly what you want:

http://forums.alliedmods.net/showpos...68&postcount=5


There is no difference between team_say and print_chat. print_chat just sends a message to the chat instead of sending a message to the console or to the hud.
stupok is offline
Qlim4X
Member
Join Date: Jun 2007
Old 07-12-2007 , 02:12   Re: Change server pass...
Reply With Quote #10

Quote:
/* AMXMOD X script.
*
* (c) Copyright 2007 Qlim4X
* This file is provided as is (no warranties).
*
* For #Pro.Gather in GrNet. Internal use only.
*
*/
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
register_plugin("pro.gather ChangePass","1.0","qlim4x")
register_concmd("pro_pass","set_password",ADM IN_BAN,"<password>")
return PLUGIN_CONTINUE
}


public set_password(id, level, cid)
{
if(!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new set_pass[32]
read_argv ( 1, set_pass, 31 )
server_exec()
set_cvar_string ( "sv_password", set_pass )
client_print(id, print_chat, "Sv_Password Change To ^"%s^"", set_pass)
return PLUGIN_HANDLED
}
is this correct??? now

how can i check if the arg 1 is null or "" so the pass to be "progather" elshe the given in the argument...

and i want team say for the admin say command
Qlim4X 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:28.


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