-
Posts
206 -
Joined
-
Last visited
Never
Posts posted by Jiraiya
-
-
what do you mean?
-
im wondering how i would go about creating a script that makes it so that players in my game can only attack other players if both players have a variable that are the same for example:
player A location: home Player B location: town player A and or B can not attack each other
Player A loation town player B location town players should be able to attack each other. what kind of script would i have to create? any tutorial sites ore example code would be nice thanks
-
is the above script done write?
-
im trying to create a variable update script that changes a when they click on a link here is the code i have so far..
<?php $username = $_COOKIE['ID_my_site']; mysql_connect("hostname", "username", "password") or die(mysql_error()); mysql_select_db("databasename") or die(mysql_error()); $sql = mysql_query("SELECT * FROM users WHERE username = '$username'"); $row = mysql_fetch_array($sql); { mysql_query("UPDATE `users` SET `location` = 'Home' WHERE username = '$username'") or die(mysql_error()); echo '<center>You are home'.$username.'</center>'; }else{ echo '<center>You aren't allowed there</center>'; } ?>
-
i want to make it so that people cannot view a page unless there "rank" variable is equal to "Kage" how would i go about doing that?
-
im sorry. my question is how would i start this script? here is what i want my leveling script to do.
Skill/maxskill skill=players current skill maxskill=skill needed to level up.
i want level one is 1000/2000 so a player will need to gain 1000 skill so that his skill is equal to the maxskill variable 2000/2000 then a level up link should be shown.
when i player does level up i need to add 1 to the players current level and then to double the maxskill so that when a player reaches level two a players max skill goes from 2000 to 4000 i want the max skill to keep doubling every time a player levels up
if someone could help me get started that would be great thanks
-
im trying to create a leveling script thats based on a "skill" variable. i have it set up to display a players "current skill/max skill" the maxskill variable is supposed to be the skill needed for the player to leve up
-
I'm trying to write a script that allows a logged in user to view a bunch of web pages only if there rank status is set to donator how would i go about starting this script?
-
this is what it displayed when i echoed it
query:username:
-
is that right?
$username = $_COOKIE['ID_my_site']; $sql = mysql_query("SELECT * FROM users WHERE username = '$username'"); $row = mysql_fetch_array($sql); if($row['skill'] > 5000000){ mysql_query("UPDATE `users` SET `village` = 'Akatsuki' WHERE username = '$username'") or die(mysql_error()); } ?>
-
its supposed to update a users variable
-
i have my script thats supposed to edit one variable if only if another variable is equal to or greater then 5 million but it dosnt seem to work here is the script
<?php mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("members") or die(mysql_error()); $sql = mysql_query("SELECT * FROM users WHERE username = '$username'"); $row = mysql_fetch_array($sql); if($row['skill'] > 5000000){ mysql_query("UPDATE `users` SET `village` = 'Akatsuki' WHERE username = '$username'") or die(mysql_error()); } ?>
-
i added a were script put it still dosent work
-
im not sure whats wrong with my updating script
$username = $_COOKIE['ID_my_site']; $sql = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error()); if($r = mysql_fetch_assoc($sql)) { $skill = $r['skill']; if($skill >= 5000000) { //$rank = Akatsuki; //Unless Akatsuki is a constant, it should be in quotes. $rank = 'Akatsuki'; $query = "UPDATE users rank = '$rank=Akatsuki";
-
is this rite for updating the rank variable?
$username = $_COOKIE['ID_my_site']; $sql = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error()); if($r = mysql_fetch_assoc($sql)) { $skill = $r['skill']; if($skill >= 5000000) { //$rank = Akatsuki; //Unless Akatsuki is a constant, it should be in quotes. $rank = 'Akatsuki'; $query = "UPDATE users rank = '$rank=Akatsuki";
-
what do i do in order to stop them from my php files from getting deleted
-
is there any kind of code i can put on my pages to prevent back door scripts from hacking my site
-
im confused about how to write the script so that it takes a logged in users data from a table and updates one variable if another variable meets a certain requirement, i have the code below but i want to make sure its done correctly so i dont ruin my table
UPDATE users SET column1=value, column2=value2,... WHERE some_column=some_value if($skill >= 5000000) { $rank = Akatsuki;
-
whats the update statement
-
i need help with my script. i need it to change Variable B for a logged in user if variable A is equal to 5000000 and then to update variable B the database
$username = $_COOKIE['ID_my_site']; $sql = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error()); if($skill >= 5000000) { $rank = Akatsuki; } ?>
-
yes i do mean changing a database variable but im not sure how to write the scritp here is what i have so far
$username = $_COOKIE['ID_my_site']; $sql = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error()); if($skill >= 5000000) { $rank = Akatsuki; } ?>
-
-
Im having trouble getting this data to be displayed in a table could someone help the code is below.
// Make a MySQL Connection $query = "SELECT village, SUM(skill), SUM(health) FROM users GROUP BY village"; $result = mysql_query($query) or die(mysql_error()); $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo "Village ". $row['village']. " total power: ". $row['SUM(skill)']; echo "Village ". $row['village']. " total health: ". $row['SUM(health)']; echo "<br />"; } // generate and execute query $query = "SELECT * FROM townranks ORDER BY sk DESC"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); // if records present if (mysql_num_rows($result) > 0) { // iterate through resultset // print article titles while($row = mysql_fetch_object($result)) { ?> <tr> <td><?php echo $row->townname; ?></td> <td><?php echo $row->hp; ?></td> <td><?php echo $row->sk; ?></td> <td><?php echo $row->kage; ?></td> <td><?php echo $row->people; ?></td> </tr> <table border="1"> <tr> <th>Villag</th> <th>Health</th> <th>Skill</th> <th>Current Hokage</th> <th>Citizens</th> </tr> <?php } } // if no records present // display message else { ?> <p>No press releases currently available</p> <?php } // close database connection mysql_close($connection); ?>
-
i want to the php to check my database to verify that a variable is equal to or greater then the required number before changing the other variable
how would i do this?
in PHP Coding Help
Posted
what script would i need to add to make it so the player wouldnt be able to run the attack php script unless both are player variable locations are set to "Area"