Raised This Month: $ Target: $400
 0% 

Client_print linux issue?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raa
Senior Member
Join Date: Oct 2005
Old 11-20-2006 , 20:30   Client_print linux issue?
Reply With Quote #1

Why does this code return the correct "kills" in a win32 cs server;
(You are a Private with 114 kills)

but in a linux cs server it returns;
(You are a Private with rF0 kills)

Code:
#include <amxmodx>
#include <amxmisc>
#include <csstats>

#define RANK_CIVILIAN 0
#define RANK_PRIVATE 1
#define RANK_MARSHALL 2

#define MAXRANKS 3

new PlayerRank[33]

new const RANKS[MAXRANKS][] = 
{ 
	"Civilian",
	"Private",
	"Marshall"
}

public plugin_init() 
	{
	register_plugin("Rank Display", "1.0", "")
	register_clcmd("say /myrank","showrank");
}

public showrank(id)     
	{  
	if(!is_user_connected(id))
		return 0
	
	new stats[8]
	new kills[8]
	get_user_stats(id, stats, kills)	
	
	new name[33]
	get_user_name(id, name, 32)
	
	if(stats[0] < 1)
		{
		PlayerRank[id] = RANK_CIVILIAN
	}
	if(stats[0] >= 1 && stats[0] <= 3)
		{
		PlayerRank[id] = RANK_PRIVATE
	}
	if(stats[0] >= 3)
		{
		PlayerRank[id] = RANK_MARSHALL
	}
	client_print(id,print_chat, "You are a %s with %s kills", RANKS[PlayerRank[id]], stats[0]);
	
	return 0
}
Thanks for any help you can give.
raa is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-20-2006 , 21:16   Re: Client_print linux issue?
Reply With Quote #2

Change your second %s to %i.

%s is for strings, %i is for integers, %f is for floats, and %d is either for miscellaenous, or possibly it auto-detects which type to use. I've never really figured that out.

EDIT: I asked Suzuka, and she confirms what yang said, which is that %d works only for integers, ie an alternative to %i (or vice-versa).
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS

Last edited by XxAvalanchexX; 11-20-2006 at 22:32.
XxAvalanchexX is offline
raa
Senior Member
Join Date: Oct 2005
Old 11-20-2006 , 21:31   Re: Client_print linux issue?
Reply With Quote #3

thank you very much.. I could'nt find that info in the documentation/forums..
raa is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-20-2006 , 22:25   Re: Client_print linux issue?
Reply With Quote #4

%d is also for integars.
__________________
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
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 06:48.


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