-CrAzY- Posted August 28, 2007 Share Posted August 28, 2007 I Modified Admin.php So I Could Kill ( Set A Users HP To 0 ) Someone In Admin Panel Instantly, This Is What I Did: I Added This To Admin.php case 'modkill': modkill(); break; case 'modkillsub': modkillsub(); break; Then Added This To Admin.php [[url='admin.php?action=modkill']Modkill[/url]] And Added This To Admin.php function modkill() { print "Modkill ID Of The User To Be Modkilled: "; } function modkillsub() { global $ir,$c,$userid; { mysql_query("UPDATE users WHERE userid={$_POST['id']} SET hp=0",$c); print "Mod Killed!! "; } } It Partly Works, I Can Get Onto The Modkill Screen, And I Can Put Someones User ID Into The Box And It Will Say Modkilled!!, But It Dosent Put There HP Down To 0, What Have I Done Wrong Thanks!! Quote Link to comment Share on other sites More sharing options...
-CrAzY- Posted August 28, 2007 Author Share Posted August 28, 2007 Re: Admin.php Modification - Why Isn't It Working??? Its Something To Do With The MySql Query , I Think Quote Link to comment Share on other sites More sharing options...
UCC Posted August 28, 2007 Share Posted August 28, 2007 Re: Admin.php Modification - Why Isn't It Working??? This is one of the things I dont like about the query system V1.1 uses. It does not give you proper error messages the way v2.0 does. Anyway, your problem is this mysql_query("UPDATE users WHERE userid={$_POST['id']} SET hp=0",$c); Should Be mysql_query("UPDATE users SET hp=0 WHERE userid={$_POST['id']}",$c); There may or may not be other issues but that is a major one I saw pretty easy Quote Link to comment Share on other sites More sharing options...
-CrAzY- Posted August 28, 2007 Author Share Posted August 28, 2007 Re: Admin.php Modification - Why Isn't It Working??? thanks very much +1, im not that good at Sql, i copyed query in admin.php and tryed to edit it, thanks! could you help me with this problem: i added this to header.php: if($ir['hp'] == 0) { header("Location: dead.php"); exit; } because you could not 'Die' earlier, but when someone who is dead ( hp is 0) logs on it says: Warning: Cannot modify header information - headers already sent by (output started at /home/imgame/public_html/header.php:1) in /home/imgame/public_html/header.php on line 80 please help and again, thanks for the sql :-) Quote Link to comment Share on other sites More sharing options...
UCC Posted August 28, 2007 Share Posted August 28, 2007 Re: Admin.php Modification - Why Isn't It Working??? That is a tough one. You cannot just use the header function wherever you want. It would have to be the very first output in the code so it can be tricky, especially without getting rid of the Login.php redirect for logged off players. I haven't messed with this much but you might try something like this instead. Not sure if it will work for you, but I know Oxi was using it in his failed Minesweeper attempt <meta http-equiv='refresh' content='0; url=dead.php'> Quote Link to comment Share on other sites More sharing options...
-CrAzY- Posted August 28, 2007 Author Share Posted August 28, 2007 Re: Admin.php Modification - Why Isn't It Working??? if($ir['hp'] == 0) { <meta http-equiv='refresh' content='0; url=dead.php'> exit; } = Parse error: syntax error, unexpected '<' in /home/imgame/public_html/header.php on line 80 Quote Link to comment Share on other sites More sharing options...
UCC Posted August 28, 2007 Share Posted August 28, 2007 Re: Admin.php Modification - Why Isn't It Working??? again not making any promises but if($ir['hp'] == 0) { echo "<meta http-equiv='refresh' content='0; url=dead.php'>"; exit; } Quote Link to comment Share on other sites More sharing options...
-CrAzY- Posted August 28, 2007 Author Share Posted August 28, 2007 Re: Admin.php Modification - Why Isn't It Working??? if($ir['hp'] == 0) { echo "<meta http-equiv='refresh' content='0; url=dead.php'>"; exit; } = No Effect :( Quote Link to comment Share on other sites More sharing options...
RecklessCounty Posted August 28, 2007 Share Posted August 28, 2007 Re: Admin.php Modification - Why Isn't It Working??? Why dont you post the contents of dead.php inside the tags? Quote Link to comment Share on other sites More sharing options...
-CrAzY- Posted August 29, 2007 Author Share Posted August 29, 2007 Re: Admin.php Modification - Why Isn't It Working??? i dont want to, i want a dead.php page Quote Link to comment Share on other sites More sharing options...
John99 Posted September 7, 2007 Share Posted September 7, 2007 Re: Admin.php Modification - Why Isn't It Working??? I Modified Admin.php So I Could Kill ( Set A Users HP To 0 ) Someone In Admin Panel Instantly, This Is What I Did: I Added This To Admin.php case 'modkill': modkill(); break; case 'modkillsub': modkillsub(); break; Then Added This To Admin.php [[url='admin.php?action=modkill']Modkill[/url]] And Added This To Admin.php function modkill() { print "<h3>Modkill</h3> ID Of The User To Be Modkilled:<form action='admin.php?action=modkillsub' method='post'> <input type='text' value='0' name='id'> <input type='submit' value='Modkill'> </form>"; } function modkillsub() { global $ir,$c,$userid; { mysql_query("UPDATE users WHERE userid={$_POST['id']} SET hp=0",$c); print "Mod Killed!! "; } } It Partly Works, I Can Get Onto The Modkill Screen, And I Can Put Someones User ID Into The Box And It Will Say Modkilled!!, But It Dosent Put There HP Down To 0, What Have I Done Wrong Thanks!! And you have function modkillsub() { global $ir,$c,$userid; { mysql_query("UPDATE users WHERE userid={$_POST['id']} SET hp=0",$c); print "Mod Killed!! "; } } dont even need that just put function modkillsub() { global $ir,$c,$userid; mysql_query("UPDATE users SET hp=0 WHERE userid={$_POST['id']}",$c); print "Mod Killed!! "; } Quote Link to comment Share on other sites More sharing options...
3XTR3M3 Posted September 9, 2007 Share Posted September 9, 2007 Re: Admin.php Modification - Why Isn't It Working??? lol Quote Link to comment Share on other sites More sharing options...
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.