HLMOD.HU Forrás Megtekintés
- www.hlmod.hu#include <amxmodx>
// Rohadtul UNATKOZTAM!!!!!!
// milegyek.extra.hu <- otlet
new Fajlok[2][39], Foglalkozas[64][33], OsszesFoglalkozas[64][100], Szam
public plugin_init() {
register_plugin("Idealis foglalkozas!", "1.0", "DeRoiD")
register_clcmd("say /milegyek?", "Generalas")
register_clcmd("say /milegyek", "Generalas")
format(Fajlok[0], 38, "addons/amxmodx/configs/milegyek.cfg")
format(Fajlok[1], 38, "addons/amxmodx/configs/milegyek.ini")
Betoltes()
}
stock Betoltes()
{
new Fajl, Sor[64]
Fajl = fopen(Fajlok[0], "rt");
while(!feof(Fajl))
{
fgets(Fajl, Sor, 63);
copy(OsszesFoglalkozas[Szam], 63, Sor)
Szam++
}
fclose(Fajl);
}
stock NevEllenorzes(id, const Nev[])
{
new Fajl, Sor[128], Adat[2][64], Volt
Fajl = fopen(Fajlok[1], "rt");
while(!feof(Fajl))
{
fgets(Fajl, Sor, 127);
parse(Sor, Adat[0], 63, Adat[1], 63);
if(equal(Adat[0], Nev))
{
copy(Foglalkozas[id], 63, Adat[1])
Volt = 1
break;
}
}
fclose(Fajl);
Mutat(id, Volt, Foglalkozas[id])
return 0;
}
public Generalas(id) {
new Nev[32]
get_user_name(id, Nev, 31)
NevEllenorzes(id, Nev)
}
public Mutat(id, Letezik, const Fogl[]) {
new Nev[32], rSzam
get_user_name(id, Nev, 31)
if(Letezik == 1)
{
new Motd[512]
format(Motd, 511, "<html><head><body><p style=^"text-align: center;^"><strong><span style=^"font-size:18px;^">%s</span></strong></p><p style=^"text-align: center;^"><span style=^"font-size:24px;^">%s</span></p></body></html>", Nev, Fogl)
show_motd(id, Motd, "Idealis foglalkozas")
}
else
{
rSzam = random_num(1, Szam)
if(strlen(OsszesFoglalkozas[rSzam]) != 0)
{
copy(Foglalkozas[id], 63, OsszesFoglalkozas[rSzam])
new Sor[256]
format(Sor, 255, "^"%s^" ^"%s^"", Nev, Foglalkozas[id])
write_file(Fajlok[1], Sor)
Mutat(id, 1, Foglalkozas[id])
print_color(0, "!t%s!y -nak/nek az idelis foglalkozs:!t %s", Nev, Foglalkozas[id])
}
else
Mutat(id, 0, Foglalkozas[id])
}
}
stock print_color(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
replace_all(msg, 190, "", "á")
replace_all(msg, 190, "", "é")
replace_all(msg, 190, "", "í")
replace_all(msg, 190, "", "ó")
replace_all(msg, 190, "", "ö")
replace_all(msg, 190, "", "ő")
replace_all(msg, 190, "", "ú")
replace_all(msg, 190, "", "ü")
replace_all(msg, 190, "", "ű")
replace_all(msg, 190, "", "Á")
replace_all(msg, 190, "", "É")
replace_all(msg, 190, "", "Í")
replace_all(msg, 190, "", "Ó")
replace_all(msg, 190, "", "Ö")
replace_all(msg, 190, "", "Ő")
replace_all(msg, 190, "", "Ú")
replace_all(msg, 190, "", "Ü")
replace_all(msg, 190, "", "Ű")
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, get_user_msgid("SayText"), _, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
}
return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
*/