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

/top15 and /flop15 not visible in chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
n-o-l-o
Member
Join Date: Sep 2004
Location: Germany
Old 10-11-2006 , 21:53   /top15 and /flop15 not visible in chat
Reply With Quote #1

Hello,

maybe you are interested in how to add a /flop15 command to your statsx plugin. Well, let me tell you. Add this to your statsx.sma:

Code:
//... public SayFlop15            = 0 // displays last 15 players //... register_clcmd("say /flop15", "cmdFlop15", 0, "- display flop 15 players (MOTD)") //... register_clcmd("say_team /flop15", "cmdFlop15", 0, "- display flop 15 players (MOTD)") //... server_cmd(addStast, "Say /flop15", "SayFlop15") //... // Get and format flop 15. format_flop15(sBuffer[MAX_BUFFER_LENGTH + 1]) {     new iRanks = get_statsnum()     new iMax = iRanks     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 = iRanks - 1; i >= iRanks - iMax && MAX_BUFFER_LENGTH - iLen > 0; i--)     {         get_stats(i, izStats, izBody, t_sName, MAX_NAME_LENGTH)         replace_all(t_sName, MAX_NAME_LENGTH, "<", "[")         replace_all(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", iRanks - i, t_sName, izStats[STATS_KILLS],                         izStats[STATS_DEATHS], izStats[STATS_HITS], izStats[STATS_SHOTS], izStats[STATS_HS], effec(izStats), accuracy(izStats))     } } //... // Display MOTD flop15 ranked. public cmdFlop15(id) {     if (!SayFlop15)     {         client_print(id, print_chat, "%L", id, "DISABLED_MSG")         return PLUGIN_HANDLED     }     format_flop15(g_sBuffer)     show_motd(id, g_sBuffer, "Flop 15")         return PLUGIN_HANDLED } //...

I did this because i wanted a /flop15 command and not a /flop10 command/plugin.

It works fine and when you type /top15 or /flop15 in chat you will see the motd BUT you will not see the /top15 or /flop15 command in chat. I WANT THIS BACK !

Is it a problem with the web compiler? I guess not because i reinstalled the original statsx.amxx and the /top15 command is STILL not visible in chat. Strange huh?!

Do you know how to fix this? Please help!

Last edited by n-o-l-o; 02-03-2007 at 08:09.
n-o-l-o is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 10-11-2006 , 22:02   Re: /top15 and /flop15 not visible in chat
Reply With Quote #2

You are returning PLUGIN_HADNLED...

This makes the message not show afaik.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
n-o-l-o
Member
Join Date: Sep 2004
Location: Germany
Old 10-11-2006 , 22:07   Re: /top15 and /flop15 not visible in chat
Reply With Quote #3

Na, i tested both ! First PLUGIN_CONTINUE and then PLUGIN_HANDLED. Did not work !

But thanks for trying to help me.

Last edited by n-o-l-o; 10-12-2006 at 13:37.
n-o-l-o is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-11-2006 , 23:35   Re: /top15 and /flop15 not visible in chat
Reply With Quote #4

Quote:
Originally Posted by SweatyBanana View Post
You are returning PLUGIN_HADNLED...

This makes the message not show afaik.
he is correct.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
n-o-l-o
Member
Join Date: Sep 2004
Location: Germany
Old 10-12-2006 , 13:33   Re: /top15 and /flop15 not visible in chat
Reply With Quote #5

I did a workaround by adding this to cmdFlop15:

Code:
new szUserName[33]; get_user_name(id, szUserName, 32); new szMessage[164]; format(szMessage, 163, "^x03%s ^x01: ^x04/flop15", szUserName); message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id); write_byte(id); write_string(szMessage); message_end();

If you know another way how to solve the problem let me know. Thx.
n-o-l-o is offline
n-o-l-o
Member
Join Date: Sep 2004
Location: Germany
Old 02-03-2007 , 08:13   Re: /top15 and /flop15 not visible in chat
Reply With Quote #6

OK, maybe there is no way to solve the problem without a workaround so you find all you need here: http://compu-ag.de/phpBB3/viewtopic.php?p=855#855

Last edited by n-o-l-o; 08-20-2007 at 15:59.
n-o-l-o is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-03-2007 , 21:17   Re: /top15 and /flop15 not visible in chat
Reply With Quote #7

RETURN PLUGIN_CONTINUE GODDAMIT!
Sweaty allready kinda told ya.
[ --<-@ ] Black Rose is offline
n-o-l-o
Member
Join Date: Sep 2004
Location: Germany
Old 08-20-2007 , 15:58   Re: /top15 and /flop15 not visible in chat
Reply With Quote #8

Quote:
Originally Posted by n-o-l-o View Post
I tested both !
Read. Think. Post. Thanks.
n-o-l-o is offline
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 08-20-2007 , 16:18   Re: /top15 and /flop15 not visible in chat
Reply With Quote #9

Quote:
Originally Posted by n-o-l-o View Post
Read. Think. Post. Thanks.
You did something wrong then.

Code:
public cmdFlop15(id) {     if (!SayFlop15)     {         client_print(id, print_chat, "%L", id, "DISABLED_MSG")         return PLUGIN_HANDLED     }     format_flop15(g_sBuffer)     show_motd(id, g_sBuffer, "Flop 15")         return PLUGIN_CONTINUE }
__________________
FatalisDK is offline
Spaniard
Junior Member
Join Date: Mar 2008
Old 03-23-2008 , 19:54   Re: /top15 and /flop15 not visible in chat
Reply With Quote #10

the flop doesnt really work i think
Spaniard 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 16:14.


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