jon182 Posted April 5, 2009 Posted April 5, 2009 okin the game mods section i'm trying to make an addition to the attack part, however i'm at a roadblock. You know how the $mydamage is like a variable or whatever. Could i have a $attackspot where it chose a random number and then lets say the number is one then it sets $attackspot to "legs" or does it have to be a number? i have the base code down but thats something i've come across. ALSO how can i make it so i include 2 files in the attack file. because it alraedy has the globals file included and i need to include a file i have and if i just copy the way they include globals but change the name it shows an error. Quote
Karlos Posted April 5, 2009 Posted April 5, 2009 Re: Can you make a variable have a name like "legs"? Yes. $legs $butt $hair $jim $xD Quote
Floydian Posted April 5, 2009 Posted April 5, 2009 Re: Can you make a variable have a name like "legs"? $spot = rand(1,3); switch ($spot) { case 1: $attackspot = 'legs'; case 2: $attackspot = 'arms'; case 3: $attackspot = 'head'; default: // no default } echo "You attacked {$r['username']} and hit their $attackspot doing $mydam damage."; It sounds like you're looking for something like that. You can include hundreds of files into one script. It acts as if the script was already in the script. So, you have to make sure they jive together, or else you get errors... Hope that helps... Quote
jon182 Posted April 5, 2009 Author Posted April 5, 2009 Re: Can you make a variable have a name like "legs"? thanks a million :) 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.