How to enclose qoutation to string variable

astralprojection

New member
Messages
334
Points
0
-<tab>script<tab>test#dumb<tab>HIDDEN_NPC,1{
end;

OnWarp:
input .@playername$;
atcommand "#warp "+.@playername$+" "+.arena_map$+" 22 50";
end;

OnInit:
bindatcmd("warpthisdumbplayer","test::OnWarp",0,99);
.arena_map$ = "guild_vs2";
end;
}


I was hoping to do ( #warp "My Name Is Bond" guild_vs2 22 50 )

 
if you want double quotes to be part of a string you have to escape them

"foo \"bar\" baz"

 
@meko yes thank you. i tried
 

atcommand "#warp \"+.@playername$+\" "+.arena_map$+" 22 50";



but it returns #warp "+.@playername$+" guild_vs2 22 50.  Did i made a mistake?

 
better use way how suggested @Asheraf, because it allow use good translation,

but if you want strings concatenations, use this code:

Code:
atcommand "#warp \"" + .@playername$ + "\" " + .arena_map$ + " 22 50";
 
Back
Top