AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   /top15 and /flop15 not visible in chat (https://forums.alliedmods.net/showthread.php?t=45804)

n-o-l-o 10-11-2006 21:53

/top15 and /flop15 not visible in chat
 
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!

SweatyBanana 10-11-2006 22:02

Re: /top15 and /flop15 not visible in chat
 
You are returning PLUGIN_HADNLED...

This makes the message not show afaik.

n-o-l-o 10-11-2006 22:07

Re: /top15 and /flop15 not visible in chat
 
Na, i tested both ! First PLUGIN_CONTINUE and then PLUGIN_HANDLED. Did not work ! :(

But thanks for trying to help me.

Emp` 10-11-2006 23:35

Re: /top15 and /flop15 not visible in chat
 
Quote:

Originally Posted by SweatyBanana (Post 390105)
You are returning PLUGIN_HADNLED...

This makes the message not show afaik.

he is correct.

n-o-l-o 10-12-2006 13:33

Re: /top15 and /flop15 not visible in chat
 
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 02-03-2007 08:13

Re: /top15 and /flop15 not visible in chat
 
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

[ --<-@ ] Black Rose 02-03-2007 21:17

Re: /top15 and /flop15 not visible in chat
 
RETURN PLUGIN_CONTINUE GODDAMIT!
Sweaty allready kinda told ya.

n-o-l-o 08-20-2007 15:58

Re: /top15 and /flop15 not visible in chat
 
Quote:

Originally Posted by n-o-l-o (Post 390106)
I tested both !

Read. Think. Post. Thanks.

FatalisDK 08-20-2007 16:18

Re: /top15 and /flop15 not visible in chat
 
Quote:

Originally Posted by n-o-l-o (Post 520983)
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 }

Spaniard 03-23-2008 19:54

Re: /top15 and /flop15 not visible in chat
 
the flop doesnt really work i think


All times are GMT -4. The time now is 04:48.

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