Jump to content
MakeWebGames

Need A Lil Bit Of Help On hackpc.php Mod


-CrAzY-

Recommended Posts

Re: Need A Lil Bit Of Help On hackpc.php Mod

 

<?php
/*
-----------------------------------------------------------------------
--  Hack User's Computer
--  (C) 2006 Dabomstew
-----------------------------------------------------------------------
--  This script is distributed in the hope that
--  it will be useful, but WITHOUT A WARRANTY
--  OF ANY KIND.
-----------------------------------------------------------------------
--  Dabomstew, Criminalexistence.com, and
--  everyone else involved with this script do not
--  take any liability for damage done to your game
--  by the use of this script.
-----------------------------------------------------------------------
*/
session_start();
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm);
$h->menuarea();
print "[img=images/pccrime.png]
";
include "hackpc.config.php";
global $db_config;
$in = abs((int) $_GET['ID']);
if(!$in)
{
 print "Error - no valid player ID to hack specified.";
 $h->endpage();
 exit;
}
$q = mysql_query("SELECT * FROM `users` WHERE userid = {$in}", $c);
if(!mysql_num_rows($q))
{
 print "Error - player ID specified does not exist.";
 $h->endpage();
 exit;
}
$r = mysql_fetch_array($q);
if(in_array($in, $db_config['prohibited']))
{
 print "Error - this player cannot be hacked.";
 $h->endpage();
 exit;
}
if($r['user_level'] == 0 && $db_config['nohacknpc'])
{
 print "Error - NPCs cannot be hacked.";
 $h->endpage();
 exit;
}
if($in == $userid)
{
 print "Error - you cannot hack yourself!";
 $h->endpage();
 exit;
}
if($r['fedjail'])
{
 print "Error - people in fedjail cannot be hacked";
 $h->endpage();
 exit;
}
if($ir['brave'] < $db_config['bravecost'])
{
 print "Error - you need {$db_config['bravecost']} Brave to hack someone's PC.";
 $h->endpage();
 exit;
}
$rsf = rand(1,100);
$exga = rand($db_config['minexp'],$db_config['maxexp']);
if($rsf <= $db_config['chance'])
{
 mysql_query("UPDATE users SET exp=exp+{$exga}, brave=brave-{$db_config['bravecost']} WHERE userid={$userid}", $c);
 $stole=(int) (rand($r['money']/500,$r['money']/200));
 if ($stole<0) {$stole=0;}
 if ($stole>0)
 {
   mysql_query("UPDATE users SET money=money+{$stole} WHERE userid={$userid}", $c);
   mysql_query("UPDATE users SET money=money-{$stole} WHERE userid={$in}", $c);
 }
 event_add($in, "[url='viewuser.php?u=$userid']{$ir['username']}[/url] hacked your computer and stole \$$stole! Click [url='hackpc.php?ID={$userid}']here[/url] to try to take your revenge!", $c);
 print "You succesfully hacked {$r['username']} and stole \$$stole.";
}
else
{
 mysql_query("UPDATE users SET brave=brave-{$db_config['bravecost']} WHERE userid={$userid}", $c);
 event_add($in, "[url='viewuser.php?u=$userid']{$ir['username']}[/url] attempted to hack your computer but was stopped by your firewall.", $c);
 print "Unfortunately, {$r['username']}'s firewall was too good for you to hack past.";
}
$h->endpage();
?>

 

and i would appreciate it if u cud make it so only ppl who have bought a eltronic item can do it, but im more bothered about the id thing

Link to comment
Share on other sites

Re: Need A Lil Bit Of Help On hackpc.php Mod

try this:

 

<?php 
/* 
----------------------------------------------------------------------- 
--  Hack User's Computer 
--  (C) 2006 Dabomstew 
----------------------------------------------------------------------- 
--  This script is distributed in the hope that 
--  it will be useful, but WITHOUT A WARRANTY 
--  OF ANY KIND. 
----------------------------------------------------------------------- 
--  Dabomstew, Criminalexistence.com, and 
--  everyone else involved with this script do not 
--  take any liability for damage done to your game 
--  by the use of this script. 
----------------------------------------------------------------------- 
*/ 
session_start(); 
require "global_func.php"; 
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } 
$userid=$_SESSION['userid']; 
require "header.php"; 
$h = new headers; 
$h->startheaders(); 
include "mysql.php"; 
global $c; 
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); 
$ir=mysql_fetch_array($is); 
check_level(); 
$fm=money_formatter($ir['money']); 
$lv=date('F j, Y, g:i a',$ir['laston']); 
$h->userdata($ir,$lv,$fm,$cm); 
$h->menuarea();
include "hackpc.config.php"; 
global $db_config; 
$in = abs((int) $_GET['ID']); 
if(!$in) 
{ 
 print "Error - no valid player ID to hack specified."; 
 $h->endpage(); 
 exit; 
} 
$q = mysql_query("SELECT * FROM `users` WHERE userid = {$in}", $c); 
if(!mysql_num_rows($q)) 
{ 
 print "Error - player ID specified does not exist."; 
 $h->endpage(); 
 exit; 
} 
$r = mysql_fetch_array($q); 
if(in_array($in, $db_config['prohibited'])) 
{ 
 print "Error - this player cannot be hacked."; 
 $h->endpage(); 
 exit; 
} 
if($r['user_level'] == 0 && $db_config['nohacknpc']) 
{ 
 print "Error - NPCs cannot be hacked."; 
 $h->endpage(); 
 exit; 
} 
if($in == $userid) 
{ 
 print "Error - you cannot hack yourself!"; 
 $h->endpage(); 
 exit; 
} 
if($r['fedjail']) 
{ 
 print "Error - people in fedjail cannot be hacked"; 
 $h->endpage(); 
 exit; 
} 
if($ir['brave'] < $db_config['bravecost']) 
{ 
 print "Error - you need {$db_config['bravecost']} Brave to hack someone's PC."; 
 $h->endpage(); 
 exit; 
} 
if($r['user_level'] == 2){
print "{$r['username']} tracked you down and beat hell outta you for attempting to hack his pc";
exit;
}
$rsf = rand(1,100); 
$exga = rand($db_config['minexp'],$db_config['maxexp']); 
if($rsf <= $db_config['chance']) 
{ 
 mysql_query("UPDATE users SET exp=exp+{$exga}, brave=brave-{$db_config['bravecost']} WHERE userid={$userid}", $c); 
 $stole=(int) (rand($r['money']/500,$r['money']/200)); 
 if ($stole<0) {$stole=0;} 
 if ($stole>0) 
 { 
   mysql_query("UPDATE users SET money=money+{$stole} WHERE userid={$userid}", $c); 
   mysql_query("UPDATE users SET money=money-{$stole} WHERE userid={$in}", $c); 
 } 
 event_add($in, "[url='viewuser.php?u=$userid']{$ir['username']}[/url] hacked your computer and stole \$$stole! Click [url='hackpc.php?ID={$userid}']here[/url] to try to take your revenge!", $c); 
 print "You succesfully hacked {$r['username']} and stole \$$stole."; 
} 
else 
{ 
 mysql_query("UPDATE users SET brave=brave-{$db_config['bravecost']} WHERE userid={$userid}", $c); 
 event_add($in, "[url='viewuser.php?u=$userid']{$ir['username']}[/url] attempted to hack your computer but was stopped by your firewall.", $c); 
 print "Unfortunately, {$r['username']}'s firewall was too good for you to hack past."; 
} 
$h->endpage(); 
?>

 

it works for me and if it doesnt for you then its probably because your using lite

Link to comment
Share on other sites

Re: Need A Lil Bit Of Help On hackpc.php Mod

 

Ive Added It, But How Do I Specify Which Users I Want To Do It To I Tryed This:

www.MyGameURL!.com/hackpc.php?u=1

But It Didnt Work, Anybody Know??

Thanks!

 

This Guy Needs To Stop Coding And Start Learning No Joke

i agree

You cant say much really -

 

omg you just have it normall like www.yourgamename.com/hackpc.php

and then when the user selects its target it will automatically come up with ?u=1 at the end of it.

Which was wrong...

If you look at the start of the code :

/// Get the ID from the URL make it $in

$in = abs((int) $_GET['ID']); (Should really be $_REQUEST['ID'])

/// If $in is empty then display this error... If not then carry on.

if(!$in)

{

print "Error - no valid player ID to hack specified.";

$h->endpage();

exit;

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...