Raised This Month: $ Target: $400
 0% 

need help with little plugin)))


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
S@ndel
Junior Member
Join Date: Mar 2005
Old 10-15-2007 , 00:03   need help with little plugin)))
Reply With Quote #1

Yesterday i decide to write little plugin, that change some value on clients, when there will connect to server...

My code )
Code:
new PLUGIN[]="changestset" 
new AUTHOR[]="S@ndel" 
new VERSION[]="1.4"
new check_st = 0


public plugin_init() 
{ 
    // Register plugin 
    register_plugin(PLUGIN, VERSION, AUTHOR) 
    return PLUGIN_CONTINUE  
} 

public client_connect(id)  
{
	
	query_client_cvar(id, "cl_updaterate","updaterate")

	query_client_cvar(id, "cl_cmdrate","cmdrate")

	query_client_cvar(id, "rate","rate")

	
	
	yaebu(id)
	
	// log section start
	//server_print("----------------")
	//server_print("Here [%d] check_st: %d",id,check_st)
	//server_print("%s | %s | %s",value_updaterate,value_cmdrate,value_rate)
	//server_print("----------------")
	
	// log section end
	
	
	/*if(check_st == 1)
	{
		client_print(id,print_console,"[AMXX]: Some values was changed in your settings...")
	} else {
		client_print(id,print_console,"[AMXX]: NO values was changed in your settings...")
	}*/
	
	
	return PLUGIN_HANDLED 
} 

public updaterate(id, const cvar[], const value_updaterate[]){
	
		if(!equali("66",value_updaterate)){
		client_cmd(id,"cl_updaterate 66")
		check_st = 1
		}
		
	
	server_print("OK! %s",value_updaterate)
	
}
public cmdrate(id, const cvar[], const value_cmdrate[]){
	
	if(!equali("66",value_cmdrate)){
		client_cmd(id,"cl_cmdrate 66")
		check_st = 1
		}
	server_print("OK! %s",value_cmdrate)
	
}
public rate(id, const cvar[], const value_rate[]){
	
	if(!equali("20000",value_rate)){
		client_cmd(id,"rate 20000")
		check_st = 1
		}
	server_print("OK! %s",value_rate)
	
}

public yaebu(id){
	server_print("Here [%d] check_st: %d",id,check_st)
if(check_st == 1)
	{
		client_print(id,print_console,"[AMXX]: Some values was changed in your settings...")
	} else {
		client_print(id,print_console,"[AMXX]: NO values was changed in your settings...")
	}
	
}
So, for example, client has rate 15000
... we got query_client_cvar(id, "rate","rate")
In this function
blablabla
check_st = 1
next we have yaebu(id) function )
There var check_st is 0 ... why??? :/
I can't understand...

sr for my english)
S@ndel is offline
Send a message via ICQ to S@ndel
 



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 20:54.


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