Jump to content
MakeWebGames

Recommended Posts

Posted

basicly ive had an idea for a addon for the crystal exchange

up hosp time so say the defult hosp time is 200 mins u can up it with crystals ive seen it in other games working well with members who love it and upp there hosp times regularly

im gunna try to figure it out myself but thought i would post it here to because i was going to put it up as a free mod when i was done anyway so i figure why not get u guys to help 2 :wink:

Posted

Re: hosp time

safety from attack plus you can withdraw from bank while in hosp and can buy houses etc so if you are going to spend ?2,500,000 on a house smart ppl would go to hosp then buy the house

Posted

Re: hosp time

ok first you would want to add a new thing under the settings table in phpmyadmin

call it ct_hosp and the value whatever you want to charge

ok so in staff.php

find

Energy Refill Price (crystals): <input type='text' name='ct_refillprice' value='{$set['ct_refillprice']}' />

 

add below

Hospital time (crystals): <input type='text' name='ct_hosp' value='{$set['ct_hosp']}' />

 

then in crystaltemple.php

find

Energy Refill - {$set['ct_refillprice']} Crystals

 

add below

Hospital time - {$set['ct_hosp']} Crystals

 

later find

if($_GET['spend'] == 'refill')

{

if($ir['crystals'] <$set['ct_refillprice'])

{

print "You don't have enough crystals!";

}

else if($ir['energy'] == $ir['maxenergy'])

{

print "You already have full energy.";

}

else

{

$db->query("UPDATE users SET energy=maxenergy,crystals=crystals-{$set['ct_refillprice']} WHERE userid=$userid");

print "You have paid {$set['ct_refillprice']} crystals to refill your energy bar.";

}

}

add below

if($_GET['spend'] == 'hospitaltime')

{

if($ir['crystals'] <$set['ct_hosp'])

{

print "You don't have enough crystals!";

}

else

{

$db->query("UPDATE users SET hospital=hospital+1,crystals=crystals-{$set['ct_hosp']} WHERE userid=$userid");

print "You have paid {$set['ct_hosp']} crystals to up your hospital time by 1 minute.";

}

}

Posted

Re: hosp time

ok this is what i have so far ive tested it on my site and it scemes to work for me

open attackbeat.php

find

$db->query("UPDATE users SET hp=1,hospital=$hosptime,hospreason='Hospitalized by <a href=\'viewuser.php?u={$userid}\'>{$ir['username']}</a>' WHERE userid={$r['userid']}");
event_add($r['userid'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] beat you up.",$c);
$atklog=mysql_escape_string($_SESSION['attacklog']);
$db->query("INSERT INTO attacklogs VALUES('',$userid,{$_GET['ID']},'won',unix_timestamp(),-1,'$atklog');");
$_SESSION['attackwon']=0;

 

replace with

$db->query("UPDATE users SET hp=1,hospital=hospital+200+{$ir['htime']},hospreason='Hospitalized by <a href=\'viewuser.php?u={$userid}\'>{$ir['username']}</a>' WHERE userid={$r['userid']}") or die("mysql_error");
event_add($r['userid'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] Hospitalized you.",$c);
$atklog=mysql_escape_string($_SESSION['attacklog']);
$db->query("INSERT INTO attacklogs VALUES('',$userid,{$_GET['ID']},'won',unix_timestamp(),-1,'$atklog');");
$_SESSION['attackwon']=0;

 

find

 

$hosptime=rand(50,150)+floor($ir['level']/2);

 

and delete

open crystaltemple.php

find

[url='crystaltemple.php?spend=refill']Energy Refill - {$set['ct_refillprice']} Crystals[/url]

 

add below

 

 [url='crystaltemple.php?spend=hospitaltime']Hospital time - {$set['htime']} Crystals[/url]



later find

if($_GET['spend'] == 'refill')
{
if($ir['crystals'] <$set['ct_refillprice'])
{
print "You don't have enough crystals!";
}
else if($ir['energy'] == $ir['maxenergy'])
{
print "You already have full energy.";
}
else
{
$db->query("UPDATE users SET energy=maxenergy,crystals=crystals-{$set['ct_refillprice']} WHERE userid=$userid");
print "You have paid {$set['ct_refillprice']} crystals to refill your energy bar.";
}
}

add below

 

else if($_GET['spend'] == 'htime')
{
print "Type in the amount of Crystals you want to swap for Extra Hospitalize Time.

You have [b]{$ir['crystals']}[/b] Crystals.

You currently have [b]$blah[/b] Minutes Hospitalize Time.

[b]20 Crystals = 1 Extra Minute Hospitalize Time.[/b]<form action='blackmarket.php?spend=htime2' method='post'><input type='text' name='crystals' />
<input type='submit' value='Swap' /></form>";
}
else if($_GET['spend'] == 'htime2')
{
$_POST['crystals']=(int) $_POST['crystals'];
if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals'])
{
print "Error, you either do not have enough crystals or did not fill out the form.


[url='crystaltemple.php?spend=htime']> Back[/url]";
}
else
{
$iqgain=$_POST['crystals']*0.05;

mysql_query("UPDATE users SET crystals=crystals-{$_POST['crystals']} WHERE userid=$userid",$c);

mysql_query("UPDATE users SET htime=htime+$iqgain WHERE userid=$userid",$c);

print "You traded {$_POST['crystals']} Crystals for $iqgain Extra Hospitalize Time.
";
}
}

 

run this sql

 

ALTER TABLE `users` ADD `htime` int(11) NOT NULL default '0';

 

and ur done i think lol

ty melton_ricky14 for ur imput but it confused what i was doing but if u want to add a admin feature to what i have done feel free i will also be posting this in the free mod section

Posted

Re: hosp time

yours will work im sure...all mine does is add hospital time from the crystal temple....just like energy....will work if your in the hospital or not...

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