#include <amxmodx>
#include <amxmisc>
new gi_topexp = 0, gsz_topexpname[64] = "none", gsz_topexplvl[64] = 0;
new gszFileDir[64];
public plugin_init()
{
register_plugin("", "Autorska", "Knopers");
get_basedir(gszFileDir, 31);
format(gszFileDir, 63, "%s/plugins/zp_top/zp_top.txt", gszFileDir);
readTop();
}
public plugin_end()
{
new pos[128];
formatex(pos, 127, "topexp ^"%d^"", gi_topexp);
write_file(gszFileDir, pos, 0);
formatex(pos, 127, "topexpname ^"%s^"", gsz_topexpname);
write_file(gszFileDir, pos, 1);
formatex(pos, 127, "topexplvl ^"%s^"", gsz_topexplvl);
write_file(gszFileDir, pos, 2);
}
bool:readTop()
{
if (file_exists(gszFileDir))
{
new Data[128], len;
new line = 0;
new pos[2][64];
while((line = read_file(gszFileDir, line, Data, 127, len)) != 0)
{
if (strlen(Data)<2 || Data[0] == '[' || Data[0] == ';')
continue;
parse(Data, pos[0], 63, pos[1], 63);
remove_quotes(pos[0]);
remove_quotes(pos[1]);
if(equali(pos[0], "topexp"))
gi_topexp = str_to_num(pos[1]);
else if(equali(pos[0], "topexpname"))
gsz_topexpname = pos[1];
else if(equali(pos[0], "topexplvl"))
gsz_topexplvl = pos[1];
}
}
else
{
write_file(gszFileDir, "topexp ^"0^"", 0);
write_file(gszFileDir, "topexp ^"none^"", 1);
write_file(gszFileDir, "topexp ^"0^"", 2);
return false;
}
return true;
}
Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse