Help with a stock.
#1

Hi guys, I am pretty much noob at scripting so if you find something really stupid, that's the reason. I really did want to solve this by myself but after two hours I decided to just give up and ask for help. So here I am.

I am using a file management plugin called 'dFile' and I tried to create a stock which will open a specific user file, read a specific line, save and close the file and return the line. I didn't get an error but I do have one warning and the stock doesn't seem to work also;

PHP код:
warning 215expression has no effect 
PHP код:
stock GetInfo(targetidstring)
{
new 
variable[128];
format(variable128"%s.ini"GetName(targetid));
new 
message[256];
dfile_Open(variable);
message dfile_ReadString("%s"), string// The line which gives me the warning.
dfile_SaveFile();
dfile_CloseFile();
return 
message;

Any help is appreciated!
Reply
#2

I have never seen "dFile", but I think this is what's wrong.
pawn Код:
message = dfile_ReadString("%s", string); // The line which gives me the warning.
Reply
#3

Tried that but it gave me two warnings instead;

Код:
warning 203: symbol is never used: "string"
Код:
warning 202: number of arguments does not match definition
Reply
#4

As I haven't used dFile either (never seen it by the way!) I'd say it works the same as the mysql functions and that the 'string' variable just is the variable where the string gets put into. Just like GetPlayerPos() works (it saves the x, y, z into a variable).

Please post the native here to be sure of this
Reply
#5

Код:
message = dfile_ReadString("%s");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)