Raised This Month: $ Target: $400
 0% 

Ban reasons only showing the 1st character


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mlk27
Veteran Member
Join Date: May 2008
Old 01-05-2009 , 04:25   Ban reasons only showing the 1st character
Reply With Quote #1

any idea why in the "public banhaxor" the ban reason only printed as the first character from the reason, eg the reason is "wallhack & aimbot" it will be printed as "w" only

Code:
{
// .....

	new reason[64], minutes[8]

	new cData[100]

	cData[0] = haxor //id
	cData[1] = str_to_num(minutes)

	copy(cData[2], charsmax(cData)-1, reason)

	set_task(0.5, "banhaxor", haxor, cData, 3)

	return PLUGIN_HANDLED
}

public banhaxor(cData[])
{
	new haxorid = cData[0]
	new bantime = cData[1]

	new banreason[64]
	copy(banreason, charsmax(banreason), cData[2])
	
	// debug
	log_amx("userid: #%d bantime: %d banreason: ^"%s^"", get_user_userid(haxorid), bantime, banreason)
	
	// ....
}
Code:
L 01/04/2009 - 18:06:29: [amx_banhaxor.amxx] userid: #1 bantime: 1 banreason: "w"
Mlk27 is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 01-05-2009 , 05:28   Re: Ban reasons only showing the 1st character
Reply With Quote #2

your param len is 3
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 01-05-2009 , 05:30   Re: Ban reasons only showing the 1st character
Reply With Quote #3

here is a example
Code:
public test2(id)
{
    new param[10]
    param[0] = 88
    copy(param[1], 9, "jim")
    set_task(1.0, "test3", 100, param, 9)
    return PLUGIN_HANDLED
}
 
public test3(param[], id)
{
    new reason[10]
    copy(reason, 9, param[1])
    console_print(1, "%d - %d - %s - %s", param[0], id, reason, param[1])
}
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 01-05-2009 , 09:12   Re: Ban reasons only showing the 1st character
Reply With Quote #4

hey jim thanks for codes..i understand it now

+karma
Mlk27 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 09:05.


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