Hey guys,
My friend is trying to get a line from a file (you can see how the line should look like in the file from the formatex function he used), I helped him design it a bit cuz it didnt work for him and thats what came out:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Prisoner Count"
#define VERSION "1.0"
#define AUTHOR "CreePs"
new PrisonerID[33];
new HighestPrisoner;
new filename[256]
public plugin_init()
{
get_configsdir( filename, 255 )
format(filename, 255, "%s/prisoner.ini", filename);
register_clcmd("say /test", "cmdTest")
}
public cmdTest(id)
{
client_print(id, print_chat, "TESTDSDGFTDGF")
}
public client_putinserver(id)
{
Load(id);
}
Load(id)
{
new data[128];
new Name[64];
new Authid[64];
new ID[64];
new Checkid[64];
new Highest[256];
get_user_name(id, Name, 63);
get_user_authid(id, Checkid, 63);
new szReadData[200]
new file = fopen(filename, "r")
while( fgets(file, data, sizeof(data) - 1) )
{
parse(data, Name, charsmax(Name), Authid, charsmax(Authid), ID, charsmax(ID), Highest, charsmax(Highest) );
if( equal(Checkid, Authid) )
{
PrisonerID[id] = str_to_num(ID);
set_user_info( id, "name", Name )
fclose(file)
return PLUGIN_CONTINUE
}
HighestPrisoner = str_to_num(Highest);
}
PrisonerID[id] = str_to_num(Highest) + 1;
get_user_authid(id, Authid, 63);
formatex(szReadData, charsmax(szReadData) - 1, "^"%s^" %s %i %i", Name, Authid, PrisonerID[id], PrisonerID[id] > HighestPrisoner ? PrisonerID[id] : HighestPrisoner);
fputs(file, szReadData)
fclose(file)
return PLUGIN_CONTINUE
}
Now he says it doesn't work and writes nothing, in my opinion it should work. Does someone detect something wrong?
__________________