Jump to content

Ruddy

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by Ruddy

  1. Well that is the code I have been using to do it, even tried working with the guy tho coded it and he couldnt do it. I think that is a cause for help. If so I will go elsewhere I would have just liked some help. From that code im sure someone can find where I have gone wrong with the blurry image. And point in the right direction would me nice at least.
  2. Hey all, I'm new to java script and for those of you that play minecraft, you should know that you can have a skin. Them skins are stored at minecraft.net and are public. I would like to get the skin of a user and using java script put it together in a 2D view and enlarge the size. I have come across something that does do this here: http://code.google.com/p/minecraft-skin-viewer/source/browse/trunk/js/mcSkinRenderer.js?r=2 This will put together a skin, but I have been at it for days trying to get the image bigger without getting it blurry. I can make it bigger but it always goes blurry, I know it can be done as I have seen sites do it but in 3D. I want to get the head of the skin and enlarge it to 64px - 64px. If anyone could write the code for this it would be amazing and if they have time write comments as I would love to learn this sort of thing. Example of a skin : http://www.minecraft.net/skin/Ruddy2007.png That is my skin. Thank you and good luck.
  3. Thank you creata.physics, I get what I was doing wrong now. fixed and the code is a lot less. Thanks again.
  4. // Get the users armour names $user_armour = array($user_head, $user_upper, $user_hands, $user_lower, $user_feet); $i=0; while($i < count($user_armour)) { $query1="SELECT * FROM armour WHERE id='$user_armour[$i]'"; $result1=mysql_query($query1); $array1=mysql_fetch_array($result1); $armour_name[$i]=$array1["name"]; $i++; } // set the users armours name $user_prot = array($user_head, $user_upper, $user_hands, $user_lower, $user_feet); // Get the users overall protection $i=0; while($i < count($user_prot)) { $query1="SELECT * FROM armour WHERE id='$user_prot[$i]'"; $result1=mysql_query($query1); $array1=mysql_fetch_array($result1); $armour_prot[$i]=$array1["protection"]; $i++; } // set the users protection $user_protection=$armour_prot[0] + $armour_prot[1] + $armour_prot[2] + $armour_prot[3] + $armour_prot[4]; Is there a way to get them as one so: $user_armour = array($user_head, $user_upper, $user_hands, $user_lower, $user_feet); $i=0; while($i < count($user_armour)) { $query1="SELECT * FROM armour WHERE id='$user_armour[$i]'"; $result1=mysql_query($query1); $array1=mysql_fetch_array($result1); $armour_name[$i]=$array1["name"]; $armour_prot[$i]=$array1["protection"]; $i++; } // set the users armours name $user_prot = array($user_head, $user_upper, $user_hands, $user_lower, $user_feet); Will that work and if so how would you then get the 2 different values out of say "$user_prot[0]". Cheers guys, Ruddy
  5. l0gic you are a god! Thank you so much, used your code line for line! Also to everyone else, thats what I was trying to do!! Thanks again.
  6. Put that in the page where you want to see the included pages. It will then print there names for you. My guess is that if you put that at the top of the page it would print them in order of top to bottom.
  7. Erm, its not what I want but If has now givin me an idea. So it has helped. Thanks for the reply, keep up the good work!
  8. I got it to work a while ago. Thanks so much for the help!
  9. I get ya, but how would I get it to run a SQL statement in a PHP file?
  10. $value1 = 0.10 //Want this one to run into that IF to find the "$result" $value2 = 0.30 //Then this one to go in if([$value1 and $value2] < 0.20) { $result= 0.75; } elseif([$value1 and $value2] < 0.40){ $result= 0.80; } echo $result; //for $value1 echo $result; //for $value2 I know that dont make that much sense, but I want to find the $result of $value1 and output it as its own variable and the same with $value2. Hope that makes sense xD
  11. Sorry for the bump then, and forget that code. Like I said before its kinda like finding a grade for a student. But I need to do it for mulitplie grades in 1 go. So if students mark is "90" it runs through a statement that finds if thats a A,B,C,D and so on. But I want to do it for multiplle "grades". So I want to run thr mark "90" and the mark "80" right after. So in 1 click of "find grade" button it will grab them 2 values run them through and output a grade for each. I hope that makes sense.
  12. Don't think you need to be rude, and I didnt ask anyone to do what you was going to go. Was asking if anyone else knew how to do what I want. I didnt tell you to do it I asked if you could would be great (it would), I just was trying to do it ASAP as once I start I dont like to stop. If you could help would be great. Cheers, Ruddy.
  13. Right, see if i got this right. You go to that file and set it so on a date/time of your choice it will run a file that you choose? If that is right I cannot find the file to set another file to run at a time I choose. If im wrong could you explain? Cheers, Ruddy.
  14. Hey guys, I dont know if you can do this in PHP due to it only running when the page loads but I would like to make it so at the end of everyday "24:00" some code will run that will reset all users "Mana" and "Health". My guess would be JQuery or somthing like that? If anyone knows would be great for a reply. Cheers guys, Ruddy
  15. Can anyone else help with this please?
  16. erm, I think that would work. If kinda like finding a grade for a student. But I need to do it for mulitplie grades in 1 go. Does that make any sense? But i think what you said would work if you could do that would be great. Comments to teach me why you did what would also be amazing.
  17. What I want to do is run both '$intel_mod' and '$op_intel_mod' in that if statement and output 2 different variables for both of them. e.g: So '$intel_mod' goes in and comes out as '$int_mod = 0.85' Then '$op_intel_mod' should go in and come out as '$op_int_mod'. Somthing like that is what im after, im now thinking this is not the way to do it or I should be using a loop? $intel_mod = $user_int/$op_int; $op_intel_mod = $op_int/$user_int; if($intel_mod < 0.20) { $int_mod = 0.75; } elseif($intel_mod < 0.40){ $int_mod = 0.80; } elseif($intel_mod < 0.60){ $int_mod = 0.85; } elseif($intel_mod < 0.80){ $int_mod = 0.90; } elseif($intel_mod < 0.1){ $int_mod = 0.95; } elseif($intel_mod == 1){ $int_mod = 1; } elseif($intel_mod > 2){ $int_mod = 1.10; } elseif($intel_mod > 3){ $int_mod = 1.20; } elseif($intel_mod > 4){ $int_mod = 1.30; } elseif($intel_mod > 5){ $int_mod = 1.40; } elseif($intel_mod > 0.20){ $int_mod = 1.50; } Any help would be great, Ruddy
  18. Fixed my own problem guys, thanks for the replys tho!
  19. Im still working on it and thats all that part has. All I want is: How to grab rows from the database and print them in a table Grab the ID that a user selects using a button, from one of the many rows in that created table. That ID will be used in a SELECT statment in the WHERE clause to select the monster they will fight. I have started from scratch again so any help would be great.
  20. Bump, please guys I really need to get this done ASAP! Cheers.
  21. But how would the array go? Could you show a bit more? I havebeen trying for ages! Cheers for the reply. EDIT: Bump, anyone else got any ideaS?
  22. Hey guys. I have ran into a problem once again. I want to print a list of data I have in my database being monsters (ID, Name, HP, attack) I want to be able to print them fromt he database then get the "ID" of the monster being selected by a submit button to give the id of that row in some form (a POST?) so i can get the information for that monster in a SELECT when the button is hit. I will try show you what im trying to do. //Grt the id from the table print at the bottom. $monster_id = $_POST["monsterid"]; //this is at the top to get stats on the monster the user has selected to fight $query="SELECT * FROM monsters WHERE id='$monster_id'"; $result=mysql_query($query); $result=mysql_fetch_array($result); $monster_exp=$result["exp"]; $exp_dead = round(($monster_exp/100) * 10); $monster_hp =$result["hp"]; $goldwon =$result["gold"]; $mindam =$result["mindam"]; $maxdam =$result["maxdam"]; // my battle code goes here using the stats I want above. ------------------------------------------------------------------------------ //This is where the user selects the monster they want to fight. $query="SELECT * FROM monsters"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; <form action="training.php" method="post"> <table border='0' width="400" class="tablee"> <tr> <th>Monster</th> <th>Level</th> <th>HP</th> <th>Protection</th> <th>Fight?</th> </tr> <? $query="SELECT * FROM monsters"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"id"); $name=mysql_result($result,$i,"name"); $level=mysql_result($result,$i,"lvl"); $hp=mysql_result($result,$i,"health"); $pro=mysql_result($result,$i,"pro"); ?> <tr> <th><? echo $mon_name; ?> </th> <th><? echo $mon_level; ?> </th> <th><? echo $mon_hp; ?> </th> <th><? echo $mon_pro; ?> </th> <th><input type="hidden" value="<? echo $mon_id; ?>" name="monsterid" /> <input type="submit" value="Fight!" name="submit" /></th> </tr> <? $i++; } ?> </table> </form> I hope this makes sense because I am really having problems. My gues is use an array but I could get it to work. PS: I did a get and it sends ALL the IDs instead of the selected row. Thanks for any help guys, Ruddy
  23. Hey, I did it this way. What do you think? $hp=10; $mhp = 10; $mtotaldam=0; $totaldam=0; do { $damdone = rand(2,4); $mdamdone = rand(2,4); $totaldam+=$damdone; $mtotaldam+=$mdamdone; if($totaldam>=$mhp){ echo "you hit it with a finishing blow for $damdone <br />"; echo"You killed it <br />"; break; } else{ echo "you hit it for $damdone <br />"; } if($mtotaldam>=$hp){ echo "It hit you with a finishing blow for $mdamdone <br />"; echo"It killed you. <br />"; break; } else{ echo "It hit you for $mdamdone <br />"; } } while ($win=1);//cause an INF loop
  24. Im not really sure what you mean, I get why what your trying to do but have no idea how to complete it. Would you be able to explain abit more? I came up with this but it does not work. $whosTurn = 'player'; $hp='10'; $mhp = '10'; $mtotaldam='1'; $totaldam='1'; do { switch ($whosTurn){ case 'player': $damdone = 1*rand(1,2) + rand(1,2) + 1 + 1; echo "You hit the monster for $damdone.<br />"; $totaldam+=$damdone; $whosTurn='monster'; break; case 'monster': $damtaken = 1*rand(1,3) + rand(1,4) + 1 + 1; echo "The monster hit you for $damtaken. <br />"; $mtotaldam+=$damtaken; $whosTurn='player'; break; } } while ($totaldam <= $mhp || $mtotaldam <= $hp);
  25. Hey guys, I am having a problem with making a system where it is turn based attacks. I want it so a user can attack a monster and the monster can attack back, the output I want is like. You hit the monster for 5. The monster hit you for 7. You hit the monster for 3. The monster hit you for 6. and so on. I have been going at this for ages and cannot get what I want. I had problems such as: The monster attacking when it should be dead. Even when the monster was dead the user would still attack. This is the code I have now that is maybe totaly wrong, thats why I need your guys help! $monster_hp = 10; $userhp =10; for ($i=1,$n=1; $i<=$monster_hp, $n<=$userhp; $n+=$damtaken, $i+=$damdone){ $damtaken = 1*rand(1,3) + rand(1,4) + 1 + 1; $damdone = 1*rand(1,2) + rand(1,2) + 1 + 1; echo "You hit the monster for $damdone.<br />"; echo "The monster hit you for $damtaken. <br />"; } The output for that is: You hit the monster for 5. The monster hit you for 7. You hit the monster for 5. The monster hit you for 5. That is wrong due to the monster having 10 hp and I have hit him for 10hp overall. I know that thats because the echo is in the loop so it has to run but I have tried so many ways to get this to work and cannot do it. If I die, it should stop with the monsters attack and a message saying "The monster has killed you", if I win it should stop his next attack and say "You have killed the monster". Please help me guys, you have helped me before so I know how good some of you are. Thank you so much for anyhelp that is givin. Ruddy.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.