Raised This Month: $ Target: $400
 0% 

Idea for STATX.SMA,add a title


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
akson
Junior Member
Join Date: Dec 2004
Location: TAIWAN
Old 04-06-2006 , 10:37   Idea for STATX.SMA,add a title
Reply With Quote #1

I add some string in statx lol
like this
Code:
new g_Visc[60][] =
{
	"神(GOD)  ",
	"Monster   ", 
	"XXX         ", 
	"BlackJack",
	"Amigo近衛隊", 
	"Amigo聖騎士", 
	"Amigo聖戰士", 
	"殺手至尊    ", 
	"龍五        ",
	"龐德特派員  ",
	"特種恐怖戰士",
	"神槍手      ",
	"全民公敵    ",
	"頭號通緝犯  ",
	"銅鑼灣扛霸子", //15
	"巨靈守護使  ", 
	"極地戰神    ",
	"破魔將軍    ",
	"誡魔行者    ",
	"獵天使者    ",
	"穿雲使者    ",
	"破日使者    ",
	"擊月使者    ",
	"撕夜使者    ",
	"近衛軍教頭  ",
	"鳳尊殺手    ",
	"龍尊殺手    ",
	"麟尊殺手    ",
	"超級殺手    ",
	"護國法師    ",
	"絕頂高手    ",
	"大內高手    ",
	"高級殺手    ",
	"忍者        ",
	"極度嗜殺狂  ",
	"變態殺人狂  ",
	"極惡戰狂    ",
	"張錫銘      ",
	"中級殺手    ",
	"暗殺者      ",
	"江洋大盜    ",
	"刺客        ",
	"恐怖組織首領",
	"邪惡組織首領",
	"殺手組織首領",
	"恐怖組織隊長",
	"邪惡組織隊長",
	"殺手組織隊長",
	"恐怖組織成員",
	"邪惡組織成員",
	"殺手組織成員",
	"蠻族兵      ",
	"初級殺手    ",
	"盜賊        ",
	"流氓        ",
	"逃犯        ",
	"惡霸        ",
	"阿米果游擊隊", 
	"阿米果游擊隊", 
	"阿米果游擊隊"
}
'cause I don't want use amxmodx\data\XXX.txt
I add some code to statx
Thai is color word(radio) &team join (enter_leave message)function

Code:
public client_color(playerid,colorid,msg[]){
		new playerslist[32],playerscount//,i
		get_players(playerslist,playerscount,"c")
		new userid
		if(playerid==0){
			userid=playerid
			message_begin(MSG_ALL, get_user_msgid("SayText"), {0,0,0}, userid) 
			write_byte(colorid)
			write_string(msg)
			message_end()
				
		}
		else{
			userid=playerid
			message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, userid) 
			write_byte(colorid)
			write_string(msg)
			message_end()
		}
}
N

Code:
public team_join(){
	new izStats[8], izBody[8]
	new id=read_data(1)
	if(teamjoined[id]) return
	teamjoined[id]=1
	new welcomemsg[129],username[33]
	new iRankPos
	get_user_name(id,username,32)
	if (cvar_exists("csstats_reset")){ 
		iRankPos = get_user_stats( id, izStats, izBody )
		if (iRankPos < 58){
			format(welcomemsg,128,"^x01Welcome^x03%s^x01,Rank is ^x04%d^x01,Title: ^x04%s^x01",username,iRankPos,g_Visc[iRankPos-1])
		}else
		format(welcomemsg,128,"^x01Welcome^x03%s^x01,Rank is ^x04%d^x01",username,iRankPos)
	}else	format(welcomemsg,128,"^x01Welcome^x03%s^x01,未入榜",username)
	client_color(0,id,welcomemsg)
Last~ top15 source code is
Code:
// Get and format top 15.
format_top15(sBuffer[MAX_BUFFER_LENGTH + 1])
{
	new iMax = get_statsnum()
	new izStats[8], izBody[8]
	new iLen = 0

	if (iMax > 15)
		iMax = 15

	new lKills[16], lDeaths[16], lHits[16], lShots[16], lEff[16], lAcc[16]
	
	format(lKills, 15, "%L", LANG_SERVER, "KILLS")
	format(lDeaths, 15, "%L", LANG_SERVER, "DEATHS")
	format(lHits, 15, "%L", LANG_SERVER, "HITS")
	format(lShots, 15, "%L", LANG_SERVER, "SHOTS")
	format(lEff, 15, "%L", LANG_SERVER, "EFF")
	format(lAcc, 15, "%L", LANG_SERVER, "ACC")
	
	ucfirst(lEff)
	ucfirst(lAcc)

	iLen = format(sBuffer, MAX_BUFFER_LENGTH, "<body bgcolor=#000000><font color=#FFB000><pre>")
	iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "%2s %-22.22s %6s %6s %6s %6s %4s %4s %4s^n", "#", "Nick", lKills, lDeaths, lHits, lShots, "HS", lEff, lAcc)
	
	for (new i = 0; i < iMax && MAX_BUFFER_LENGTH - iLen > 0; i++)
	{
		get_stats(i, izStats, izBody, t_sName, MAX_NAME_LENGTH)
		iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "%2d %-22.22s %6d %6d %6d %6d %4d %3.0f%% %3.0f%%^n", i + 1, t_sName, izStats[STATS_KILLS], 
						izStats[STATS_DEATHS], izStats[STATS_HITS], izStats[STATS_SHOTS], izStats[STATS_HS], effec(izStats), accuracy(izStats))
	}
}
I fix it like this

Code:
format_top15(sBuffer[MAX_BUFFER_LENGTH + 1])
{
	new iMax = get_statsnum()
	new izStats[8], izBody[8]
	new iLen = 0

	if (iMax > 15)
		iMax = 15

	new lKills[16], lDeaths[16], lHits[16], lShots[16], lEff[16], lAcc[16]
	
	format(lKills, 15, "%L", LANG_SERVER, "KILLS")
	format(lDeaths, 15, "%L", LANG_SERVER, "DEATHS")
	format(lHits, 15, "%L", LANG_SERVER, "HITS")
	format(lShots, 15, "%L", LANG_SERVER, "SHOTS")
	format(lEff, 15, "%L", LANG_SERVER, "EFF")
	format(lAcc, 15, "%L", LANG_SERVER, "ACC")
	
	ucfirst(lEff)
	ucfirst(lAcc)

	iLen = format(sBuffer, MAX_BUFFER_LENGTH, "<meta http-equiv='content-type' content='text/html; charset=UTF-8'><body bgcolor=#000000><font color=#FFB000><pre>")
	iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "%2s %-22.22s        %s            %6s    %6s   %4s %4s %4s^n", "Rank", "Wanted", "Title", lKills, lDeaths, "HS", lEff, lAcc)
	
	for (new i = 0; i < iMax && MAX_BUFFER_LENGTH - iLen > 0; i++)
	{
		get_stats(i, izStats, izBody, t_sName, MAX_NAME_LENGTH)
		iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "%2d  %-22.22s  %s %6d %6d  %4d  %3.0f%%  %3.0f%%^n", i + 1, t_sName, g_Visc[i], izStats[STATS_KILLS], 
						izStats[STATS_DEATHS], izStats[STATS_HS], effec(izStats), accuracy(izStats))
	}
}
screenshot:
TOP15 and title

Welcome MSG


It is a very small skill I hope you like
Sorry my english is not good
Attached Files
File Type: sma Get Plugin or Get Source (statsx.sma - 863 views - 55.5 KB)
__________________
210.208.185.45
akson is offline
Send a message via MSN to akson
alsdf
New Member
Join Date: Sep 2007
Old 09-18-2008 , 07:43   Re: Idea for STATX.SMA,add a title
Reply With Quote #2

niCe work but can you change the lang to english please
alsdf is offline
alsdf
New Member
Join Date: Sep 2007
Old 09-18-2008 , 07:47   Re: Idea for STATX.SMA,add a title
Reply With Quote #3

i need it english not china because
i show ????? not dosn't like your screen shot ! ! can you help me
alsdf is offline
YKH =]
Senior Member
Join Date: Sep 2008
Location: Hong Kong
Old 09-18-2008 , 09:11   Re: Idea for STATX.SMA,add a title
Reply With Quote #4

English version

i don't know some words mean therefore don't mind my bad english
__________________
Approved Plugins

[ZP] Effect Plugins :
Damage Effect
Real Death

Last edited by YKH =]; 09-18-2008 at 09:13.
YKH =] is offline
YKH =]
Senior Member
Join Date: Sep 2008
Location: Hong Kong
Old 09-18-2008 , 09:14   Re: Idea for STATX.SMA,add a title
Reply With Quote #5

it can compile now
Attached Files
File Type: sma Get Plugin or Get Source (statsx1.sma - 791 views - 55.3 KB)
__________________
Approved Plugins

[ZP] Effect Plugins :
Damage Effect
Real Death
YKH =] is offline
alsdf
New Member
Join Date: Sep 2007
Old 09-25-2008 , 08:16   Re: Idea for STATX.SMA,add a title
Reply With Quote #6

thnx very much
alsdf 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 20:43.


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