Uridium Posted December 15, 2009 Posted December 15, 2009 In the original V2 script when a user atacks or is being attacked its always a default message that appears example is below.. DONT USE THIS AS ITS FROM THE ORIGINAL V2 For you htting them You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. And for them hitting you.... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. So as you can see the wording is always the same unless you change it manualy in the script and even then youd need to do it every week so suers dont get bored... However this little mod can change all that you can write as many outcomes as you want and when the user is attacking they will see different outcomes after every hit.. so open your attack.php and add these under the include"globals.php"; You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Now create 4 txt files with these names youhit.txt theyhit.txt youfail.txt theyfail.txt all you need to do now is add some wording to the files and where the YOU HIT is just use $word For YOU HIT and $word2 FOR THEY HIT and $word3 FOR YOU FAIL and $word4 for THEY FAIL.... You can do the exact same for the Event add just create another file and do as above :) EXAMPLE BELOW incase i confused anyone You Hitting them You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. And for them hitting you.... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Uridium Posted December 15, 2009 Author Posted December 15, 2009 I have only given a Guideline for the above DONT use the attack parts only the PART that needs adding which is this to attack.php $filename="youhit.txt";$words=file($filename);shuffle($words);$word=$words[0]; // THIS IS FOR YOU HIT THEM $filename="theyhit.txt";$words2=file($filename);shuffle($words2);$word2=$words2[0]; // THIS IS FOR THEY HIT YOU $filename="youfail.txt";$words3=file($filename);shuffle($words3);$word3=$words3[0]; // THIS IS FOR YOU MISSED THEM $filename="theyfail.txt";$words4=file($filename);shuffle($words4);$word4=$words4[0]; // THIS IS FOR THEY MISSED YOU And then use the Oucome messages where ever you want them Oh and upload all the TXT files to your server Quote
h.a.r.o.l.d Posted January 25, 2010 Posted January 25, 2010 download file ? i'am not speak English :( Quote
4thdesign Posted January 31, 2010 Posted January 31, 2010 Can you clarify the txt files? In the txt files, how do we write the message? Quote
wrx Posted January 31, 2010 Posted January 31, 2010 Can you clarify the txt files? In the txt files, how do we write the message? i think he means something like this youhit.txt ( Illusions might need to clarify this as you said ) You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. wrx Quote
Uridium Posted February 1, 2010 Author Posted February 1, 2010 I see why everyone is confused cos ive just re-read what i put and it confused me aswell lol Ok in a nutshell on the statement where YOUHIT you need to make the youhit.txt with various different statements for that particular outcome. So print "<font color=red>{$_GET['nextstep']}. Using your {$r1['itmname']} you hit {$odata['username']} doing $mydamage damage ({$odata['hp']}) $word</font> \n"; $_SESSION['attackdmg']+=$mydamage; $_SESSION['attacklog'].="<font color=red>{$_GET['nextstep']}. Using {$myabbr} {$r1['itmname']} {$ir['username']} hit {$odata['username']} doing $mydamage damage ({$odata['hp']})</font> \n"; } the $word statement on this one will call for the file called youhit.txt This being $filename="youhit.txt";$words=file($filename);shuffle($words);$word=$words[0]; so for the statement you youfail use $word3 on the statment for youfail and for theyhit use $word2 for the statment theyhit and for theyfail use $word4 and for theyfail Hope that clears things up Quote
4thdesign Posted February 1, 2010 Posted February 1, 2010 Thanks for the info. However, call me stupid (no ... dont really) but i was more confused by the txt file. How is this laid out? Like this? (as wrx posted) attack kick shank backhand or something else? Is the txt file really that simple? Quote
Uridium Posted February 1, 2010 Author Posted February 1, 2010 example on the theyfail.txt you could put something like Tried to hit you but fell over Tried to hit you but at the last minute collapsed getting up quickly to continue Tried to hit you as you strafe left they slide passed you your unharmed remember each time you press ENTER that will count as a new text Quote
Magictallguy Posted February 3, 2010 Posted February 3, 2010 Why use files? You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Simple stuff ;) Quote
rulerofzu Posted February 3, 2010 Posted February 3, 2010 You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Magictallguy Posted February 4, 2010 Posted February 4, 2010 That way works too (and is more efficient for those that care).. But you may want to add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. above that to ensure there are no errors (error_reporting(E_ALL)) Quote
rulerofzu Posted February 4, 2010 Posted February 4, 2010 Yeah that is there just forgot to inc in the cut n paste. I use it for a variety of different things through the game. You can also span style color the text making the quotes different colors. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.