PHP Code:
num_to_str(tempid, szTempid, 9)
Use charsmax() instead, hardcoding isn't allowed.
PHP Code:
public ResetBankMenu_Hundler(id, iResetBank,item)
{
if(item == MENU_EXIT)
{
menu_destroy(iResetBank)
return PLUGIN_HANDLED
}
new access,callback,data[6],iname[64]
menu_item_getinfo(iResetBank,item,access,data,5,iname,63,callback)
new tempid = str_to_num(data)
ResetBankMenu_Caller(id, tempid)
menu_destroy(iResetBank)
return PLUGIN_HANDLED
}
The first check isn't required since you already destroy the menu at the end of your function, and yet again, use charsmax() instead of hardcoding your array sizes.
PHP Code:
new iPlayers[MAX_PLAYERS], iNum
PHP Code:
new players[32], tempid, pnum
new szTempid[10]
get_players(players, pnum, "ch")
Try creating arrays using the same name and method to improve the readability. Also, try to figure out yourself what you're doing wrong here... Keep using the MAX_PLAYERS define.
PHP Code:
new szInput[32]
Array size could be decreased since it's very rare you'll ever get that much cash.
PHP Code:
new args[129], arg_cmd[6], cTarget[32], cMoney[10]
read_args(args, 128)
remove_quotes(args)
parse(args, arg_cmd, 5, cTarget, 31, cMoney, 9)
Again, don't hardcode... It seems like you've just been copy/pasting the entire code.
PHP Code:
stock ColorChat(index, const Msg[], {Float, Sql, Result,_}:...)
{
if (!is_user_connected(index))
return;
new Buffer[512], Buffer2[512], Prefix[32]
get_pcvar_string(g_pCvarPrefix, Prefix, charsmax(Prefix))
formatex(Buffer2, charsmax(Buffer2), "^x04%s ^x01%s", Prefix, Msg);
vformat(Buffer, charsmax(Buffer), Buffer2, 3);
replace_all(Buffer, charsmax(Buffer), "!g", "^x04"); // Green Color
replace_all(Buffer, charsmax(Buffer), "!n", "^x01"); // Default Color
replace_all(Buffer, charsmax(Buffer), "!t", "^x03"); // Team Color
message_begin(MSG_ONE_UNRELIABLE, g_iMsgSayText, _, index);
write_byte(index);
write_string(Buffer);
message_end();
}
// color chat without prefix
stock ShowColorMessage(const id, const input[], any:...)
{
new count = 1, players[32];
static Msg[191];
vformat(Msg, charsmax(Msg), input, 3);
replace_all(Msg, charsmax(Msg), "!g", "^4"); // verde
replace_all(Msg, charsmax(Msg), "!n", "^1"); // galben/alb/negru
replace_all(Msg, charsmax(Msg), "!t", "^3"); // rosu/albastru/gri
replace_all(Msg, charsmax(Msg), "!t2", "^0"); // rosu2/albastru2/gri2
if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, g_iMsgSayText, _, players[i]);
write_byte(players[i]);
write_string(Msg);
message_end();
}
}
}
}
And yea, this doesn't make sense at all tbh... Just use OciXCrom's colorchat, or either just use the colorchat.inc for easier use. There's no need for you to create 2 stocks to seperate prefixes or not.
__________________