[ HELP ] Definition - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [ HELP ] Definition (
/showthread.php?tid=143845)
[ HELP ] Definition -
ToMmY1547 - 24.04.2010
pawn Код:
new jmeno[MAX_PLAYER_NAME];
GetPlayerName(playerid, jmeno, sizeof(jmeno));
new cesta[24] = "nakupy/"+jmeno+".txt"; //error
Re: [ HELP ] Definition -
DeathOnaStick - 24.04.2010
More info?
What is the error?
Re: [ HELP ] Definition -
Miguel - 24.04.2010
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
Re: [ HELP ] Definition -
CAR - 24.04.2010
Try this:
pawn Код:
new cesta[24];
format(cesta,sizeof(cesta), "nakupy/%s.txt", jmeno);
Re: [ HELP ] Definition -
Virtual1ty - 24.04.2010
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);
Re: [ HELP ] Definition -
DeathOnaStick - 24.04.2010
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.
Re: [ HELP ] Definition -
ToMmY1547 - 24.04.2010
Many thanks to all