jokerofsouls Posted September 20, 2008 Share Posted September 20, 2008 Thanks for reading this I have been having problems with my echo i need it to do something, but it will not work. pUnit:SendChatMessage(11,0,"Test") I can't find out how to get the " on there with the echo without it giving me a error. This is what i have so far echo "pUnit:SendChatMessage(". $Type . ",0," . $Say .")<br />"; Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/ Share on other sites More sharing options...
Zane Posted September 20, 2008 Share Posted September 20, 2008 have you tried pUnit:SendChatMessage(11,0,"\"Test\"") Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646157 Share on other sites More sharing options...
jokerofsouls Posted September 20, 2008 Author Share Posted September 20, 2008 Sorry im little new at php i need it so it will print like this pUnit:SendChatMessage(11,0,"Test") But for the echo i have to have Another " in there and it messes with the script. Thats what i need help with Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646161 Share on other sites More sharing options...
Zane Posted September 20, 2008 Share Posted September 20, 2008 use single quotes instead echo 'pUnit:SendChatMessage(11,0,"Test")'; Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646168 Share on other sites More sharing options...
jokerofsouls Posted September 20, 2008 Author Share Posted September 20, 2008 Sorry for confusing you but i want it so one i put it in a <input name="Say" type="text" /> That it will print pUnit:SendChatMessage("11,0,"Test") echo "pUnit:SendChatMessage(". $Type . ",0," . $Say . ")<br />"; But i can't because i can't put the " anyway in the (". $Type . ",0," . $Say . ") without messing it up. Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646170 Share on other sites More sharing options...
F1Fan Posted September 20, 2008 Share Posted September 20, 2008 I think you're confusing all of us. Put ALL of your code that has anything to do with your problem (including the variable definitions, etc.) in a code window, AND type out EXACTLY how you want it to print out on the page. Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646175 Share on other sites More sharing options...
jokerofsouls Posted September 20, 2008 Author Share Posted September 20, 2008 Ok sorry echo "pUnit:SendChatMessage(". $Type . ",0," . $Say . ")<br />"; Ok i want it so one you type something in something like this http://luaxl.blackapplehost.com/aaalua.php It will come out with the test changed one i click submit pUnit:SendChatMessage(11,0,"Test") But i want the " " to stay one it prints it out Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646183 Share on other sites More sharing options...
F1Fan Posted September 20, 2008 Share Posted September 20, 2008 OK, I officially have no idea what you're asking. But, I'm trying! 1st, where is the value of the variable $Type determined? 2nd, where is the value of the variable $Say determined? 3rd, what in the world is pUnit:SendChatMessage? (is it a function, or just text you wand displayed on the page, or what?) Ultimately, what do you want this code to do? Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646186 Share on other sites More sharing options...
jokerofsouls Posted September 20, 2008 Author Share Posted September 20, 2008 <html><body> <?php $name = $_POST['name']; $unit = $_POST['unit']; $Entry = $_POST['Entry']; $Say = $_POST['Say']; $Type = $_POST['Type']; $Sound = $_POST['Sound']; echo "Function ". $name . "_onCombat (pUnit, Event)" . $unit ." <br />"; echo "pUnit:PlaySoundToSet(". $Sound . ")<br />"; echo "pUnit:SendChatMessage(". $Type . ",0," . $Say . ")<br />"; ?> </body></html> pUnit:SendChatMessage is for lua im trying to make a luascript maker this is what it would look like one im trying to have the " " in the script "pUnit:SendChatMessage(". $Type . ",0,"" . $Say . "")<br />"; But that dont work i need the SendChatMessage(11,0,"Test") the " that are allready in the sendchatmessage. Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646188 Share on other sites More sharing options...
Zane Posted September 20, 2008 Share Posted September 20, 2008 looks like this question bares repeating have you tried pUnit:SendChatMessage(11,0,"\"Test\"") if you want to echo a double quote.....the put a backslash in front of it should look like this in the end "pUnit:SendChatMessage(\"" . $Type . "\",0,\"" . $Say . "\");" or you can just use single quotes like I said earlier 'pUnit:SendChatMessage("' . $Type . '",0,"' . $Say . '");' Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646190 Share on other sites More sharing options...
jokerofsouls Posted September 20, 2008 Author Share Posted September 20, 2008 Sorry about that thanks Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646193 Share on other sites More sharing options...
F1Fan Posted September 20, 2008 Share Posted September 20, 2008 Are you trying to echo the return value of a function? Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646194 Share on other sites More sharing options...
jokerofsouls Posted September 20, 2008 Author Share Posted September 20, 2008 i got it thanks so much guys Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646195 Share on other sites More sharing options...
Zane Posted September 20, 2008 Share Posted September 20, 2008 Hurray! he got it....topic solved Function name_onCombat (pUnit, Event) pUnit:PlaySoundToSet(sound) pUnit:SendChatMessage("type",0,"say"); Link to comment https://forums.phpfreaks.com/topic/125039-echo-help/#findComment-646196 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.