Jump to content
MakeWebGames

jail bust.php gains labour experience .


athena26

Recommended Posts

 

This Basic updated will keep Members active .

Also if you remove 'labour' from gym.php . You will only gain "labour" stat only from jail .

Simply replace this with your jailbust.php 

 

Pm: if anyone could add a gang function were gang members gain more experience breaking there own gang members out. 

 

<?php
    include_once "globals.php";
if($ir['energy'] < 10)
{
  die("Sorry, it costs 10 energy to bust someone. You only have {$ir['energy']} energy. Come back later.");
}
if($ir['jail'])
{
  die("You cannot bust out people while in jail.");
}
$_GET['ID']=abs((int) $_GET['ID']);
$r=$db->fetch_row($db->query("SELECT * FROM users WHERE userid={$_GET['ID']}"));
if(!$r['userid'])
{
  die("Invalid user");
}
if(!$r['jail'])
{
  die("That user is not in jail!");
}
$mult=$r['level']*$r['level'];
$chance=min(($ir['crimexp']/$mult)*50+1, 95);
if(rand(1,100) < $chance)
{
  
  $labGain = 1000;
  $db->query("UPDATE `userstats` SET `labour` = `labour` + $labGain WHERE `userid` = $userid");
  
  $gain=$r['level']*5;
  echo "You successfully busted {$r['username']} out of jail.<br />
  You gained 1000 labour.<br />
  &gt; <a href='jail.php'>Back</a>";
  $db->query("UPDATE users SET crimexp=crimexp+{$gain}, jail_busts=jail_busts+1 WHERE userid=$userid");
  $db->query("UPDATE users SET jail=0 WHERE userid={$r['userid']}");

  event_add($r['userid'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> busted you out of jail.", $c);
}
else
{
  echo "While trying to bust out your friend, a guard spotted you and dragged you into jail yourself. Unlucky!<br />
  &gt; <a href='jail.php'>Back</a>";
  $time=min($mult, 1);
  $db->query("UPDATE users SET jail=$time, jail_reason='Caught trying to bust out {$r['username']}' WHERE userid=$userid");
  event_add($r['userid'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> was caught trying to bust you out of jail.", $c);
}
$h->endpage();
?>
 

 

Edited by athena26
Added more info
  • Like 2
Link to comment
Share on other sites

$them=$db->fetch_row($db->query("SELECT gang FROM users WHERE userid={$_GET['ID']}"));

$me=$db->fetch_row($db->query("SELECT gang FROM users WHERE userid={$ir[userid']}"));

if ($them = $me) {   $labGain = 1000 * whatever multiplier you choose;  } else { $labGain = 1000;}

$db->query("UPDATE `userstats` SET `labour` = `labour` + $labGain WHERE `userid` = $userid");

  • Like 1
Link to comment
Share on other sites

1 hour ago, newttster said:

$them=$db->fetch_row($db->query("SELECT gang FROM users WHERE userid={$_GET['ID']}"));

$me=$db->fetch_row($db->query("SELECT gang FROM users WHERE userid={$ir[userid']}"));

if ($them = $me) {   $labGain = 1000 * whatever multiplier you choose;  } else { $labGain = 1000;}

$db->query("UPDATE `userstats` SET `labour` = `labour` + $labGain WHERE `userid` = $userid");

I'm using sniko gang mod , so for the query do I replace gang for family_mod .

$them=$db->fetch_row($db->query("SELECT family_mod FROM users WHERE userid={$_GET['ID']}"));

Link to comment
Share on other sites

That's 1000 labour per bust . 

 

I also added a VIP gym were you can train labour and rob skill .. creating this VIP Gym I was able to make 45$ from donations . I have a gta mod which I got from here for non donators were they gain 500 rob skill per gta they commit, so I decided to add a VIP gym for donators only , containing two hard stats to gain on my game , those being labour and rob skill . This method attracted members to donate . As now they have a option to train the hardest stats . 

Here's my GTA file ...

gta.php

Edited by athena26
  • Like 2
Link to comment
Share on other sites

Yes it works perfectly fine .

I didn't add the SQL tables for GTA .

Add this to Cron minute
$db->query("UPDATE users SET maxGTA=0 WHERE maxGTA > 0");

Then simply add robskill to users stats .


--
-- Table structure for table `gta`
--

CREATE TABLE `gta` (
  `carID` int(11) NOT NULL,
  `carPRISON` int(11) NOT NULL DEFAULT '0',
  `carSVALUE` int(11) NOT NULL DEFAULT '0',
  `carNAME` text NOT NULL,
  `carPIC` text NOT NULL,
  `carIQ` decimal(11,6) NOT NULL DEFAULT '0.000000'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `gta`
--

INSERT INTO `gta` (`carID`, `carPRISON`, `carSVALUE`, `carNAME`, `carPIC`, `carIQ`) VALUES
(1, 1, 1000, 'Acura Integra', 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTuP-01Bp7nQNJbVwTqiTnE4Ag709e0ZaXoYw&usqp=CAU', 10.000000),
(2, 1, 2500, 'Audi 100 Avant quattro', 'http://www.motor-trade-insider.com/images/audi-100-avant-1984.jpg', 100.000000),
(3, 1, 5000, 'White Van', 'https://media.istockphoto.com/photos/blank-truck-ready-for-branding-picture-id157283564?k=6&m=157283564&s=612x612&w=0&h=HVGOqf9Jv7_D2Sm3v-kBgg3yiQLEbtWlTn-YHs6HLqg=', 100.000000),
(4, 1, 10000, 'Golf GTi', 'https://www.razaoautomovel.com/wp-content/uploads/2018/05/2018-vw-golf-gti-tcr-concept-1440x960.jpg', 100.000000),
(5, 1, 25000, 'Mercedes Benz', 'https://i.pinimg.com/originals/db/33/17/db3317a6390cbd2b81c88baacce1996d.jpg', 100.000000),
(6, 1, 50000, 'Porsche Cayenne', 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQAPC504OaE1WucL9-i_kpQzxynLqGSyaA7eA&usqp=CAU', 100.000000),
(7, 1, 150000, 'Ferrari sf90', 'https://cdn.motor1.com/images/mgl/0x6J3/s1/ferrari-sf90-stradale.jpg', 100.000000),
(8, 1, 350000, 'Bentley', 'https://auto-drive.pt/wp-content/uploads/2020/09/bentley-continental-gt-mulliner-coupe.jpg', 100.000000),
(9, 1, 350000, 'Bugatti', 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/14bugatti-divo-99leadgallery-1535035005.jpg?crop=0.822xw:1.00xh;0.109xw,0&resize=640:*', 100.000000),
(10, 1, 500000, 'Lamborghini', 'https://i.pinimg.com/originals/e7/d2/9a/e7d29a41124aeeb702f8af34b8bdd989.jpg', 100.000000);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `gta`
--
ALTER TABLE `gta`
  ADD PRIMARY KEY (`carID`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `gta`
--
ALTER TABLE `gta`
  MODIFY `carID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
COMMIT;


ALTER TABLE `userstats` ADD 

`robskill` decimal(11,6) NOT NULL default '0.000000'

Edited by athena26
Link to comment
Share on other sites

  • 11 months later...

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