Raised This Month: $51 Target: $400
 12% 

Solved I think its a bug :\


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AloneMan
Junior Member
Join Date: Feb 2017
Old 02-22-2017 , 15:11   I think its a bug :\
Reply With Quote #1

Hi guys how are u ?

i am newbie to Amx

i tried to edit a welcome message plugin that i don't find it now

Anyway this is my code
HTML Code:
amx_enter_message = register_cvar("amx_enter_message", "blaBlaBla")
amx_leave_message = register_cvar("amx_leave_message", "BlaBlaBla") 
as it looks like it should show BlaBlaBla when player joins a team (e.g. Terrorists)but it writes welcome and i don't know how to fix it .. i tried to delete file and rename the plugin but it has problem ..

This is full code :

HTML Code:
#include <amxmodx>
#include <csx>
new amx_enter_message, amx_leave_message, hostname
new team_has_changed
new g_iHudSyncObj

public plugin_init()
{
	register_plugin("test", "test", "AloneMan")

	amx_enter_message = register_cvar("amx_enter_message", "Test")
	amx_leave_message = register_cvar("amx_leave_message", "Test") 

g_iHudSyncObj = CreateHudSyncObj()
		
	
}

public client_infochanged(id){
	if( !is_user_bot(id) && get_user_team(id)==1 && team_has_changed==false ){
		static param[34], len
		param[0] = id
		len = get_user_name(id, param[1], 31)
		set_task(2.0, "enter_tr_msg", 0, param, len + 2)	
		team_has_changed = true
	}
	if( !is_user_bot(id) && get_user_team(id)==2 && team_has_changed == false){
		static param[34], len
		param[0] = id
		len = get_user_name(id, param[1], 31)
		set_task(2.0, "enter_ct_msg", 0, param, len + 2)	
		team_has_changed = true
	}


}


public client_disconnect(id)
{
	
	if(get_user_team(id)==1){
		static param[34], len
		param[0] = id
		len = get_user_name(id, param[1], 31)
		set_task(2.0, "leave_tr_msg", 0, param, len + 2)
	}else{
		static param[34], len
		param[0] = id
		len = get_user_name(id, param[1], 31)
		set_task(2.0, "leave_tr_msg", 0, param, len + 2)
	}
}

public enter_tr_msg(param[],id)
{
	
	
	static message[192], data[8], rankpos[8], pos
	get_pcvar_string(amx_enter_message, message, 191)
	replace(message, 191, "%name%", param[1])
	replace_all(message, 191, "%team", "Terrorists!")
	replace_all(message, 191, "\n", "^n")

	set_hudmessage(200, 100,0, 0.32, 0.20, 0, 3.0, 3.0, 0.5, 0.15, -1)
	ShowSyncHudMsg(0, g_iHudSyncObj, message)

	}

	
public enter_ct_msg(param[],id)
{
	if(team_has_changed){
	static message[192],  data[8], rankpos[8], pos
	get_pcvar_string(amx_enter_message, message, 191)
	
	replace(message, 191, "%name%", param[1])
	replace_all(message, 191, "\n", "^n")
	replace_all(message, 191, "%team", "Counter-Terrorists!!")	
	set_hudmessage(0, 100,200, 0.05, 0.55, 0, 6.0, 6.0, 0.5, 0.15, -1)
	ShowSyncHudMsg(0, g_iHudSyncObj, message)
}
	}


	


public leave_tr_msg(param[])
{
	static message[192]
	get_pcvar_string(amx_leave_message, message, 191)

	replace(message, 191, "%name%", param[1])
	replace_all(message, 191, "\n", "^n")
	replace_all(message, 191, "%team", "Terrorists!")
	
	set_hudmessage(200, 100,0, 0.32, 0.20, 0, 3.0, 3.0, 0.5, 0.15, -1)
	ShowSyncHudMsg(0, g_iHudSyncObj, message)
}
public leave_ct_msg(param[])
{
	static message[192]
	get_pcvar_string(amx_leave_message, message, 191)

	replace(message, 191, "%name%", param[1])
	replace_all(message, 191, "\n", "^n")
	replace_all(message, 191, "%team", "Counter-Terrorists!!")
	
	set_hudmessage(0, 100,200, 0.05, 0.55, 0, 6.0, 6.0, 0.5, 0.15, -1)
	ShowSyncHudMsg(0, g_iHudSyncObj, message)
}
i know it is treble coding anyway but this is a test ...

Thanks anyWay.....

Last edited by AloneMan; 02-23-2017 at 08:52.
AloneMan is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-23-2017 , 07:14   Re: I think its a bug :\
Reply With Quote #2

You know what a cvar is? Changing a cvar in the sma file won't do anything. You need to add it in amxx.cfg.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
AloneMan
Junior Member
Join Date: Feb 2017
Old 02-23-2017 , 08:51   Re: I think its a bug :\
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
You know what a cvar is? Changing a cvar in the sma file won't do anything. You need to add it in amxx.cfg.
Ohh sry id did not Know that

Thanks for your help bro <3

Last edited by AloneMan; 02-23-2017 at 08:52.
AloneMan 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 18:14.


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