PDA

View Full Version : Whats wrong with this functions


Gangster-rocks
02/10/2012, 05:09 PM
stock WriteInlog(name[],str[])
{
new location[128];
format(location,sizeof(location),"%s.sav",name);
if(fexist(location))
{
new File:log = fopen(location,io_append);
fwrite(log,str);
fclose(log);
}
else { printf("Log %s is not found",location);}
return 1;
}
stock Createlog(name[])
{
new location[128];
format(location,sizeof(location),"%s.sav",name);
new File:log = fopen(location,io_append);
fclose(log);
return 1;
}
its writes but only one line how to make it writes every player that has used a command and ban log ect

Gangster-rocks
02/10/2012, 05:30 PM
bumb sorry for it but i need help

RedFusion
02/10/2012, 05:53 PM
replace stock with public, might help
remember to forward both of the functions.

Gangster-rocks
02/10/2012, 06:08 PM
its works but its writes like this cords {1157880709,1151388825,1093476352);cords {1156893723,1151853832,1098251876);cords {1157908540,1151778665,1093476352);

TheDeadlyDutchi
02/10/2012, 06:15 PM
You're writing an string to the file, but the coords are an float. You should format them into an float and then write that string to the file.

Gangster-rocks
02/10/2012, 06:49 PM
I know and i fix it i have to add \r\n on the end