Jump to content
MakeWebGames

[mccode] Hack Users PC


Dabomstew
 Share

Recommended Posts

Kicking off the Lite Mods!

This is the HackPC mod adjusted to work with Lite.

Free mc code mod - requires no db edits - enjoy!

File 1: hackpc.php

<?php

/*

-----------------------------------------------------------------------

-- Hack User's Computer

-- © 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();

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, "{$ir['username']} hacked your computer and stole \$$stole! Click here 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, "{$ir['username']} 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();

?>

File 2: hackpc.config.php

<?php

/*

-----------------------------------------------------------------------

-- Hack User's Computer : Config File

-- © 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.

-----------------------------------------------------------------------

*/

$db_config = array (

'prohibited' => array(), //Add player IDs to this array who you want to be protected from hacking.

'nohacknpc' => TRUE, //Set this to true to block NPC's from being hacked.

'bravecost' => 10, //Set this to the amount of brave you want hacking a PC to cost.

'minexp' => 1, //Set this to the minimum EXP (figure, not %age) that you want a user to gain from a successful hack.

'maxexp' => 2000, //Set this to the maximum EXP (figure, not %age) that you want a user to gain from a successful hack.

'chance' => 30, //Set this to the % chance of a successful hack. Must be a positive integer >= 1.

);

?>

Edit hackpc.config.php to change the settings. Up to you to provide the Hack PC link in a user's profile (hint: viewuser.php, Hack Users PC)

Link to comment
Share on other sites

  • 2 weeks later...

[Lite] Hack Users PC

i like this... :)

only i get this error while attempting to hack

Warning: in_array(): Wrong datatype for second argument in /home/seanybob/public_html/game/hackpc.php on line 50

Unfortunately, players's firewall was too good for you to hack past.

is that my error or did anyone else get that?

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Re: [Lite] Hack Users PC

 

im getting a Parse error: syntax error, unexpected '&', expecting '(' in /public_html/battlecreekmafia/hackpc.php on line 19

and 19 th line is             

if($_SESSION['loggedin']==0) { header("Location:       login.php");exit; }                         

im getting the same

 

Parse error: syntax error, unexpected '&', expecting '(' in /home/www/doomcity.awardspace.com/hackpc.php on line 19

Link to comment
Share on other sites

Guest Anonymous

Re: [Lite] Hack Users PC

What is the point in Hack Users PC? lol. But it sounds good, but sorry ill give it a miss.

The scripts are only errored due to CE's somehow changing some codes from the scripts which makes unknown characters which PHP does not understand so will error. Thats Why Parse Error is occuring in hackpc.php/hackpc_config.php its the # ones. Try to remove them from the # to the ; and it hopefully should work =P. Its not Dabomstews fault ;)

Link to comment
Share on other sites

Re: [Lite] Hack Users PC

hackpc.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

takes long time putting them in lol

dont no if its right but i add second bit when done

hackpc.confiq.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

does that look right?

Link to comment
Share on other sites

Re: [Lite] Hack Users PC

"The scripts are only errored due to CE's somehow changing some codes from the scripts which makes unknown characters which PHP does not understand so will error. Thats Why Parse Error is occuring in hackpc.php/hackpc_config.php its the # ones. Try to remove them from the # to the ; and it hopefully should work =P. Its not Dabomstews fault Wink"

Link to comment
Share on other sites

Re: [Lite] Hack Users PC

 

"The scripts are only errored due to CE's somehow changing some codes from the scripts which makes unknown characters which PHP does not understand so will error. Thats Why Parse Error is occuring in hackpc.php/hackpc_config.php its the # ones. Try to remove them from the # to the ; and it hopefully should work =P. Its not Dabomstews fault Wink"

i did it looks right i posted it just up there a bit but i didernt change 1 or 2 of these # but i changes all of them bsicly into ;

Link to comment
Share on other sites

Re: [Lite] Hack Users PC

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

I seem to be getting this error after directingly copying it off this forum thread, I then open it up /hackpc.php to see if it works and this error comes up, line 20 seems to be

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 2 months later...

Re: [mccode] Hack Users PC

can any1 convert this to v2 mccodes please? ty

 

hackpc.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

takes long time putting them in lol

dont no if its right but i add second bit when done

hackpc.confiq.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

does that look right?

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.

 Share

×
×
  • Create New...