SA-MP Forums Archive
HTML in String - 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)
+--- Thread: HTML in String (/showthread.php?tid=652423)



HTML in String - JR_Junior - 10.04.2018

Hello!
I have an email system on my server. I can use basic HTML tags (<b>, <i>, </ br>, etc.) within strings and works perfectly.
The problem is that when I try to put the following code the pawno returns error:
PHP код:
format(Stringsizeof(String), "<a href="http://www.darkstreetrpg.com.br/" target="_blank" ><img src="https://s20.postimg.org/yvy9av9fh/logo.png" /></a>"); 
Returned error in pawno:
PHP код:
...\Server\gamemodes\GM.pwn(8318) : error 001expected token"-string end-"but found "-identifier-"
...\Server\gamemodes\GM.pwn(8318) : error 029invalid expressionassumed zero
...\Server\gamemodes\GM.pwn(8318) : warning 215expression has no effect
...\Server\gamemodes\GM.pwn(8318) : warning 203symbol is never used"http" 
Any help?


Re: HTML in String - RogueDrifter - 10.04.2018

Welp its cuz of the use of "

Idk maybe replace it with this?
Код:
format(String, sizeof(String), ''<a href=''http://www.darkstreetrpg.com.br/'' target=''_blank'' ><img src=''https://s20.postimg.org/yvy9av9fh/logo.png'' /></a>'');
Also why format a string when you're not passing any values to it?


Re: HTML in String - jasperschellekens - 10.04.2018

PHP код:
format(Stringsizeof(String), "<a href='www.darkstreetrpg.com.br/' target='_blank' ><img src='https://s20.postimg.org/yvy9av9fh/logo.png' /></a>"); 



Re: HTML in String - ExTaZZ69 - 10.04.2018

You need to escape the quotes

https://sampwiki.blast.hk/wroot/index.ph...&printable=yes


Re: HTML in String - JR_Junior - 10.04.2018

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Welp its cuz of the use of "

Idk maybe replace it with this?
Код:
format(String, sizeof(String), ''<a href=''http://www.darkstreetrpg.com.br/'' target=''_blank'' ><img src=''https://s20.postimg.org/yvy9av9fh/logo.png'' /></a>'');
Also why format a string when you're not passing any values to it?
Because this is only a part(signature) of the formated email.
Thank you!

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
PHP код:
format(Stringsizeof(String), "<a href='www.darkstreetrpg.com.br/' target='_blank' ><img src='https://s20.postimg.org/yvy9av9fh/logo.png' /></a>"); 
Worked Fine! Thank you.

Quote:
Originally Posted by ExTaZZ69
Посмотреть сообщение
Thank you!


SOLVED