Having " in a string (output) - 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: Having " in a string (output) (
/showthread.php?tid=223093)
Having " in a string (output) -
Ash. - 08.02.2011
Hi all,
Just a quick query. Is there anyway i can have a ( " ) in a string? To be written to file? I cant seem to get it in there. I assumed it would be a bit like PHP. Entering an "\" before the actual ". However that didnt work. I knows its possible, ive done it before... Any ideas?
Thanks
Ash
Re: Having " in a string (output) -
randomkid88 - 08.02.2011
You did it like this?
pawn Код:
This is a quote \"hello\"
Re: Having " in a string (output) -
TheAlienForce - 08.02.2011
Well yeh you can. Ex:
format(string,sizeof(string),"waazaa\"aa");
I used that in vb. And it works so..
Alien.
Re: Having " in a string (output) -
Ash. - 08.02.2011
Yes randomkid88 - i followed that pattern however it doesnt work.
Alien, as i explained in my first post, ive tried that and i had no luck.
Re: Having " in a string (output) - Unknown123 - 08.02.2011
pawn Код:
SendClientMessage(playerid, 0xFFFFFFAA, "\"Here is my text\"");
It will be like:
"Here is my text"
Re: Having " in a string (output) -
Ash. - 08.02.2011
This doesnt work when saving to file, nor when formatting (format) a string.
Example;
(This a piece of update code for my Scripter's Tools script)
pawn Код:
format(string, sizeof(string), "Create3DTextLabel(\"%s\", COLOUR, %f, %f, %f, 20.0, 0, 0); //%s", orig, x, y, z, params);
As you can see, i have added the \" in the corresponding area, however this doesnt work. It doesnt show when i output as a "SendClientMessage" or when i save it to file.
Re: Having " in a string (output) -
Ash. - 08.02.2011
Erm, ill give it a try
Re: Having " in a string (output) -
Ash. - 08.02.2011
Thanks!
For some reason \" now works aswell :/ - It didnt when i tested it about 10 minutes ago