Is there any script (pawn) that checks info of file, for example if that and that is written in file then that and that happens
Sorry for my bad english.
Easier way if you cant understand this: i need a code that checks text in file
GetFileText(path[]){
new File:file, text[256]; // Increase if file is big.
file = fopen(path);
fread(file,text,sizeof(text));
fclose(file);
return text;
}
Path is a path to the file you're reading, which must be placed in "scriptfiles" folder of your server dir or one of its subfolders.
GetFileText("test.txt") will return contents of "SERVER_DIR/scriptfiles/test.txt".
GetFileText("players/noob.inf") will return contents of "SERVER_DIR/scriptfiles/players/noob.inf".
etc
P.S. Don't name threads like "help me" or "why did I fail". Mentioning your problem in thread's name helps other people to find solution if they have the same problem instead of making then create duplicate threads.
Thanks for that, but i wanted something like this, but is that possible?
if(GetFileText("test.txt") == "11")){ SendClientMessage(playerid, COLOR_ORANGE, "text");
Quote from: Jancis_LV on January 31, 2010, 10:56:29 AM
Thanks for that, but i wanted something like this, but is that possible?
if(GetFileText("test.txt") == "11")){ SendClientMessage(playerid, COLOR_ORANGE, "text");
String comparison in pawn is done like the following:
if (strcmp(GetFileText("test.txt"), "11", true) == 0) SendClientMessage(playerid, COLOR_ORANGE, "text");
How to make pickup, what respawns in 0 seconds?