[ HELP ] Definition
#1

pawn Код:
new jmeno[MAX_PLAYER_NAME];
GetPlayerName(playerid, jmeno, sizeof(jmeno));
new cesta[24] = "nakupy/"+jmeno+".txt"; //error
Reply
#2

More info?
What is the error?
Reply
#3

Quote:
Originally Posted by ToMmY1547
pawn Код:
new jmeno[MAX_PLAYER_NAME];
GetPlayerName(playerid, jmeno, sizeof(jmeno));
new cesta[24] = "nakupy/"+jmeno+".txt"; //error
pawn Код:
new jmeno[MAX_PLAYER_NAME];
GetPlayerName(playerid, jmeno, sizeof(jmeno));
new cesta[24] = "nakupy/\"+jmeno+\".txt"; //error
Reply
#4

Try this:
pawn Код:
new cesta[24];
format(cesta,sizeof(cesta), "nakupy/%s.txt", jmeno);
Reply
#5

You have to use format
So it will look like this;
pawn Код:
new string[128], jmeno[MAX_PLAYER_NAME];
    GetPlayerName(playerid, jmeno, sizeof(jmeno));
    format(string, sizeof(string), "nakupy/%s.txt, jmeno);
    //write to file ... ex: new File: hFile = fopen(string, io_write);
Reply
#6

Quote:
Originally Posted by SAWC™
Quote:
Originally Posted by ToMmY1547
pawn Код:
new jmeno[MAX_PLAYER_NAME];
GetPlayerName(playerid, jmeno, sizeof(jmeno));
new cesta[24] = "nakupy/"+jmeno+".txt"; //error
pawn Код:
new jmeno[MAX_PLAYER_NAME];
GetPlayerName(playerid, jmeno, sizeof(jmeno));
new cesta[24] = "nakupy/\"+jmeno+\".txt"; //error
If that should really be a file (like the .txt stuff says), i think there cant be a file like this. ' " ' can't be entered into a filename, as far as i know.
Reply
#7

Many thanks to all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)