Abi ben aslında hatanın meyden kaynaklandığnı buldum ama o kodda hata yok. Burada bir renkli yazıyla ilgili "stringden harf alma" isimli bir konu paylaşmıştım. Orda arladaşlar sağolsunlar yardm etdiler hall etdik. .sma dosyasni compile yapinca hata vermiyor. Oyunda ise msg '86' hatasi veriyor.
Kod: Tümünü seç
// Stock: ZE Color Print
stock ze_color_p(index, const text[], any:...)
{
// Bu kısım hatasız çalışıyor ama ben bunu kullanmak istemiyorum
/*
new szMsg[128];
vformat(szMsg, sizeof(szMsg) - 1, text, 3);
replace_all(szMsg, sizeof(szMsg) - 1, "!g", "^x04");
replace_all(szMsg, sizeof(szMsg) - 1, "!n", "^x01");
replace_all(szMsg, sizeof(szMsg) - 1, "!t", "^x03");
if(index == 0)
{
for(new i = 0; i < g_maxplayers; i++)
{
if(is_user_alive(i) && is_user_connected(i))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, i);
write_byte(i);
write_string(szMsg);
message_end();
}
}
} else {
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, index);
write_byte(index);
write_string(szMsg);
message_end();
}
*/
// Bu kısım new message started when msg '86' has not been sent hatasi diyerek oyundan atiyor
new const teams[][] = {"", "TERRORIST", "CT", "SPECTATOR"}
new msg[128], main_team, team[100]
vformat(msg, charsmax(msg), text, 3)
if (containi(msg, "!t") != -1)
team = "CT"
else if (containi(msg, "!y") != -1)
team = "TERRORIST"
else if (containi(msg, "!d") != -1)
team = ""
else
team = "CT"
replace_all(msg, charsmax(msg), "!g", "^x04")
replace_all(msg, charsmax(msg), "!n", "^x01")
replace_all(msg, charsmax(msg), "!t", "^x03")
replace_all(msg, charsmax(msg), "!y", "^x03")
replace_all(msg, charsmax(msg), "!d", "^x03")
if (index == 0)
{
for (new id = 1; id <= g_maxplayers; id++)
{
if (!is_user_connected(id))
continue
main_team = get_user_team(id)
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("TeamInfo"), _, id)
write_byte(id)
write_string(team)
message_end()
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, id)
write_byte(id)
write_string(msg)
message_end()
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("TeamInfo"), _, id)
write_byte(id)
write_string(teams[main_team])
message_end()
}
}
else
{
main_team = get_user_team(index)
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("TeamInfo"), _, index)
write_byte(index)
write_string(team)
message_end()
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, index)
write_byte(index)
write_string(msg)
message_end()
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("TeamInfo"), _, index)
write_byte(index)
write_string(teams[main_team])
message_end()
}
}