Jump to content
MakeWebGames

Recommended Posts

Posted

Hello,

I am trying to get this pimpwhores.php to work. Originally SniKo's work.

 

<?php
include "globals.php";
$hprice= 50; // Price of your Hoes...
$cashphoe= $hprice * 100;

print"
  <h3>Welcome Pimp</h3>


  [i]Sign up today and pimp some whores![/i]
";
print"
  You Currently Have a Total Of {$ir['thoes']} Hoes.
";

switch($GET['action'])
{
case "cjoin":
cjoin();
break;

case "leave":
leave();
break;

case "buy":
buy();
break;

case "buyhoes":
buyhoes();
break;

case "buyconfirm":
buyconfirm();
break;

case "joinb":
joinb();
break;

default:
index();
break;
}

function index()
{
global $db, $ir,$c,$userid,$h;
print "
[url='{$_SERVER[']Join brothel And Buy Hoes[/url]

[url='{$_SERVER[']Buy Extra Hoes[/url]

[url='{$_SERVER[']Leave and loose all your hoes[/url]
";
}
function joinb()      
{
global $db, $ir,$c,$userid,$h;
print "So, you would like to join the brothel and buy some hoes?


     It costs [b]FREE[/b] to sign up and \$5000 for each hoe. From each hoe you gain \$100 a day


     [b]How many hoes would you like to buy? You need 1 To Join![/b]
     <form action='{$_SERVER['PHP_SELF']}?action=cjoin' method='post'>
     <input type=text name=hoes>
     <input type=submit value=submit>
     </form>";
}
function cjoin()
{
global $db, $ir,$c,$userid,$h;
if($ir['money'] < '$hprice')
{
print "<font color=red>Error!</font> You Dont Have Enough Cash, Sorry!


     [url='pimpwhores.php']Return to Brothel[/url]
";
}
elseif($ir['money'] > '$price')

print "We have now taken your cash and you have now joined";
$db->query("UPDATE users SET money = money - 5000 WHERE userid = $userid");
$db->query("UPDATE users SET brotheljoin = 1 WHERE userid=$userid");
}
function buy()
{
global $db, $ir,$c,$userid,$h;
print "You can only buy one hoe a day, So would you like to buy a hoe today?

     [url='{$_SERVER[']Buy your hoe ($5000)[/url]
";
}
function buyhoes()
{
global $db, $ir,$c,$userid,$h;
print "Buying A Hoe
";
if($ir['money'] < '2000')
{
print "<font color=red>Error!</font> You dont have enough for the hoe you need 2000 dollars


     [url='index.php']Back Home[/url]
";
}
if($ir['money'] > '1999')
{
print "<font color=green>Success!</font> You buy a hoe for 2000 Dollars";
$db->query("UPDATE users SET money = money - 2000 WHERE userid = $userid");
$db->query("UPDATE users SET hoesbuy = 1 WHERE userid = $userid");
$db->query("UPDATE `users` SET money = money + totalhoes * 100 WHERE userid = $userid");
}
if($ir['hoesbuy'] == 1)
{
print "<font color=red>Error!</font> You have already bought a hoe today!";
}
}
      function leave()

{
global $db, $ir,$c,$userid,$h;
print "Leaving Brothel
";
if($ir['brotheljoin'] == '0')
{
print "<font color=red>Error!</font> You are not joined in the brothel


     [url='index.php']Back Home[/url]
";
}
if($ir['brotheljoin'] == '1')
{
print "<font color=green>Success!</font> You leave the brothel and you get rid of all your hoes";
$db->query("UPDATE users SET totalhoes = 0 WHERE userid = $userid");
$db->query("UPDATE users SET brotheljoin = 0 WHERE userid = $userid");
}
}
$h->endpage();
?>

 

I have added these SQL's :

 

ALTER TABLE users ADD hoesbuy INT(11) DEFAULT 0;
ALTER TABLE users ADD brotheljoin INT(11) DEFAULT 0;
ALTER TABLE users ADD totalhoes INT(11) DEFAULT 0;

 

and put this into my cron 1 hour file :

 

$db->query('UPDATE users SET hoesbuy = 0 WHERE hoesbuy > 0 );

 

Everything works fine, when i load the file it shows the links etc but when i click any of them the site just refresh and nothing happens :S

Anyone know why this happens? :) i think it has with the cases to do but im not sure :S

Posted

Re: Pimp Whores Script

ok got it to work, but was wondering if it was possible to make it so you can only have 10 x hookers, and make it print "Sorry, its 10 hookers each player" when people try to buy...

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