
CJ - Twitch
Members-
Posts
391 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by CJ - Twitch
-
Even the default gang SQLs?
-
Well I am using lite. :love: lol. I would convert it myself but I need the SQLs. lol
-
Great work Sniko! How about you convert it for use with lite...
-
Why use flash when you can use jQuery? :)
-
You don't need one, you would like one. :) I will make one when I have time.
-
Reward System [Mod Request] [V2]
CJ - Twitch replied to KyleH112's topic in Requests & In Production
When I have time I will make a free one... -
There are loads of them out there.... Search...
-
Out of boredom I canged it so you don't need short open tags.... Not tested.. <?php //----------------------------------- // Mod created by Dave Macaulay ([email protected]) // For free use only with Mccodes V2 // For use of mod this must remain intack! //------------------------------------ if(!$_GET['print']) { require_once('globals.php'); echo '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> [b]Bank Account[/b] '; } else { session_start(); require_once('config.php'); global $_CONFIG; define("MONO_ON", 1); require_once('class/class_db_'.$_CONFIG['driver'].'.php'); $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; require_once('global_func.php'); $userid = $_SESSION['userid']; $is = $db->query("SELECT bankmoney,money FROM `users` WHERE `userid` = ".$userid) or die(mysql_error()); $ir = $db->fetch_row($is); } define('__BANKPRICE__', 5000); define('__THIS__', basename($_SERVER['SCRIPT_FILENAME'])); $_POST['amount'] = abs((int) $_POST['amount']); if($_GET['get_bank']) { echo ($_GET['simple'] ? $ir['bankmoney'] : money_formatter($ir['bankmoney'])); exit; } if($_GET['get_hand']) { echo ($_GET['simple'] ? $ir['money'] : money_formatter($ir['money'])); exit; } if($ir['bankmoney'] < 0) { new_account(); if(!$_GET['print']) { $h->endpage(); } exit; } switch($_GET['a']) { case 'deposit': deposit(); break; case 'withdraw': withdraw(); break; default: index(); break; } function new_account() { global $ir,$db,$c,$userid; if(!$_GET['print']) { ?> <script type="text/javascript"> function openAccount() { var c = confirm("Are you sure you want to open a bank account for <? echo money_formatter(__BANKPRICE__)?>?"); if(c) { $('#main_text').html('Opening account... '); $('#main_text').append('Checking you have the correct funds... '); if(<? echo $ir['money']; ?> < <? echo __BANKPRICE__; ?>) { $('#main_text').append('<span style="color: red;">Incorrect funds, You need another <? echo money_formatter((__BANKPRICE__)-$ir['money'])?>... '); } else { $.post('<? echo __THIS__; ?>?open=true&print=1', function(data) { if(data == 'not_enough_money') { $('#main_text').append('<span style="color: red;">Incorrect funds... '); } else if(data == 'opened') { $('#main_text').append('<span style="color: green;">You have succesfully opened your brand new bank account!</span> > [url="javascript:void(0);"]View Account[/url]'); } }); } } } function showBank() { $.get('<? echo __THIS__; ?>?print=1', function(data) { $('#main_text').html(data); }); } </script> <?php } if($_GET['open']) { if($ir['money'] < __BANKPRICE__) { echo 'not_enough_money'; exit; } else { $db->query("UPDATE `users` SET `money` = `money` - ".__BANKPRICE__.", `bankmoney` = 0 WHERE `userid` = ".$userid); echo 'opened'; exit; } } else { echo ' <span id="main_text"> You currently don\'t have a bank account with us, Would you like to open an account for only [i]'.money_formatter(__BANKPRICE__).'[/i]! > [url="javascript:void(0);"]Open an account![/url] </span>'; } } function index() { global $ir,$db,$c,$userid; ?> <script type="text/javascript"> function makeTrans(type) { if(type != 'withdraw' && type != 'deposit') { alert("Script Error!"); } else { var data = $('[name='+type+']'); $.post('<? echo __THIS__; ?>?print=true&a=' + type, { 'amount' : data.val() }, function(data) { $('#' + type + '_callback').html(data); $.post('<? echo __THIS__; ?>?print=true&get_bank=true', function(data) { $('#bank_money').html(data); }); $.post('<? echo __THIS__; ?>?print=true&get_bank=true&simple=true', function(data) { $('[name=withdraw]').val(data); }); $.post('<? echo __THIS__; ?>?print=true&get_hand=true&simple=true', function(data) { $('[name=deposit]').val(data); }); }); } } </script> <?php echo 'You currently have [i]<span id="bank_money">'.money_formatter($ir['bankmoney']).'</span>[/i] in your bank account. You are earning 2% interest on this daily. [url="javascript:void(0);"]> Withdraw[/url] <div id="withdraw" style="background: #ffffd3;border: 1px #ffff99 solid;display: none;padding: 20px;width: 250px;margin: 5px;"> <form action="" method="post" onsubmit="makeTrans(\'withdraw\');return false;"><input type="text" name="withdraw" value="'.($ir['bankmoney'] ? $ir['bankmoney'] : 0).'" /> <input type="submit" value="Withdraw" /></form> <div id="withdraw_callback"> [size="1"]Please select the amount you wish to withdraw then hit the withdraw button next to it.[/size] </div> </div> [url="javascript:void(0);"]> Deposit[/url] <div id="deposit" style="background: #ffffd3;border: 1px #ffff99 solid;display: none;padding: 20px;width: 250px;margin: 5px;"> <form action="" method="post" onsubmit="makeTrans(\'deposit\');return false;"><input type="text" name="deposit" value="'.($ir['money'] ? $ir['money'] : 0).'" /> <input type="submit" value="Deposit" /></form> <div id="deposit_callback"> [size="1"]Please choose the amount of money you wish to store in your account.[/size] </div> </div> '; } function deposit() { global $db,$ir,$c,$userid; if($_POST['amount'] > $ir['money']) { echo '<span style="color:red;">You do not have that much money to deposit!</span>'; } else { $fee = ceil($_POST['amount']*15/100); $fee = ($fee > 3000 ? 3000 : $fee); $gain = $_POST['amount'] - $fee; $db->query("UPDATE `users` SET `bankmoney` = `bankmoney` + ".$gain.", `money` = `money` - ".$_POST['amount']." WHERE userid=".$userid); echo 'You deposited '.money_formatter($_POST['amount']).' into your account. [size="1"]The 15% fee of '.money_formatter($fee).' was taken depositing you a final amount of '.money_formatter($gain).'.[/size]'; } } function withdraw() { global $db,$ir,$c,$userid; if($_POST['amount'] > $ir['bankmoney']) { echo '<span style="color:red;">You dont have enough money saved to withdraw that much!</span>'; } else { $db->query("UPDATE `users` SET `bankmoney` = `bankmoney` - ".$_POST['amount'].", `money` = `money` + ".$_POST['amount']." WHERE userid=".$userid); $ir['money'] += $_POST['amount']; echo 'You withdrew '.money_formatter($_POST['amount']).' into your hand from your account. [size="1"]You know have '.money_formatter($ir['money']).' in your hand.[/size]'; } } if(!$_GET['print']) { $h->endpage(); } ?>
-
Very Nice. :D
-
I think Danny has already had a bit of a bollocking so lay of him. ;) Lets get on topic. :)
-
Yeah kind of :) Look up define on php.net I just prefer to use define because Its global :) Yeah, just read up on it. Seems, in some ways, to be better than variables. :) Great work BTW. I have learnt a lot from you'r work. You're great! Thanks.
-
I'm a Chrome guy. Love it. ;) Just a quick question... define('__BANKPRICE__', 5000); Is that like using a variable?
-
YEAH! What he said. :P Dido..
-
Do what you wish. I'm sure it would be fine aslong as there not paid mods.
-
OMG. The best idea! only problem is i don't know how. dumbass. Learn, the rest of us did. ;) If I'm a dumbass why I can make a 3 column header?
-
Very nice. I made something like this for myself but it uses a DB table.
-
I said he cant't sell other peoples paid mods, As he wanted to trade the mods which he bought from other players. Nothing to do with spelling. I don't think he was on about trading modifications as it does not say that. It simply says "trade" which could be trade a couple of dollars or pounds or whatever your currency is. Where on this post did Derek say he is using illegal mods? I can't see it or am I blind.
-
Its on localhost at the moment. I will upload it tomorrow to show you. :)
-
Already done. Good mod. :) :thumbsup:
-
I don't recommend you just replace it. You should integrate it with your current login to keep the design.
-
Jordan is correct. This is all Dabs and CBs fault. They should not of let it get out of hand. Why didn't they close down raven sooner? Because there lazy. Well they are in my opinion. But now there is nothing, what so ever, they can do.
-
Want some "item breaking" code - anyone game? Paid request.
CJ - Twitch replied to ddgamedesign's topic in General Discussion
Done. made a unique copy for Derek. -
I didn't say they can't. I only changed them to help me remember them whilst writing a script. But I just think Lite is a great script. and V2 really limits you to what you can do with it. Most V2 games are Gangster/Mafia. V1 Can be anything. Well so can V2 but will require alot of work.
-
FFS just use lite. It is so much better. More flexible. Easier to secure and build onto. My copy only has about 1% of mccodes left even changed SQLs.