Try the code below. The code looks like it can be heavily optimized. I don't think you need two arrays with 2048 characters...
Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init() {
register_plugin("Something", "1.0", "pred/stupok")
register_clcmd("say", "cmd_whois", 0, "<target> ")
}
public cmd_whois(id/*, level, cid*/)
{
/*
Why check access if you set flags to 0 in the register?
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
*/
new Arg1[7]
read_args(Arg1, 6)
remove_quotes(Arg1)
if(!equal(Arg1, "/whois") return PLUGIN_HANDLED
new Arg2[32]
read_argv(2, Arg2, 31)
new player = cmd_target(id, Arg2, 1) //1 means it obeys immunity
if (!player)
{
console_print(id, "Sorry, player %s could not be found or targetted!", Arg2)
return PLUGIN_HANDLED
}
else
{
new name[32];
get_user_name(player,name,31);
new motd[2048],tempstring[2048]; //are you sure you need such large arrays?
add(motd,2048,"<html><strong><b>");
format(tempstring,2048,"Rank and Badge Stats for Player %s </strong></b>", name)
add(motd,2048,tempstring);
add(motd,2048,"<br><br>");
format(tempstring,2048,"Players Rank: %s",RANKS[g_PlayerRank[player]])
add(motd,2048,tempstring);
add(motd,2048,"<br>");
add(motd,2048,"Current Badges Owned: <br>");
for (new counter=0; counter<MAX_BADGES; counter++)
{
if(g_PlayerBadges[player][counter]!=0)
{
format(tempstring,2048," -%s<br>",BADGES[counter][g_PlayerBadges[player][counter]])
add(motd,2048,tempstring);
}
}
add(motd,2048,"</html>");
show_motd(id,motd,"Player Info")
}
return PLUGIN_HANDLED
}