
gurpreet
Members-
Posts
834 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by gurpreet
-
Re: *special* McCodes v3 BETA Release DISGUSTING! Light grey background + White text...What were you thinkin?
-
Re: Code for capped EXP? Ok so I found the following in attackleave.php $qe=$r['level']*$r['level']*$r['level']; $expgain=rand($qe/4,$qe/2); $expperc=(int) ($expgain/$ir['exp_needed']*100); print " and gained $expperc% EXP!"; What's $r mean? If it means them then the $qe=3*their level, so I'll edit according to that. $qe=$r['level']*$r['level']*$r['level']; $expgain=rand($qe/50,$qe/20); $expperc=(int) ($expgain/$ir['exp_needed']*100); print " and gained $expperc% EXP!"; Not sure though, tryna keep it so it's rand 1,50 or so. Used the example 10. Probably totally wrong but I tried
-
Re: [mccode V2] Attack :) Is 11 the ID or name? It says your in battle with 11.
-
Re: Code for capped EXP? I mean the EXP gains from leaving people, hosping and mugging. Want it to be capped at 75% not be able to go into the thousands.
-
Re: Referal in HOF Doesn't print anything, here's my code so far, I know it shows the ranks by level, need to set that to rank by referals later. Reason there are so much errors is because I was tryin to code by myself, seems I'm not ready for this stuff yet. <?php include "globals.php"; $sql = sprintf("SELECT * FROM referals WHERE (refREFER = %u)", $r['userid']); $query = mysql_query($sql) or die(mysql_error()); $refwin = mysql_num_rows($query); echo '<h4>Competitions!</h4> '; echo '<font size=5>MESSED UP ATM, SHOWING HIGHEST TO LOWEST LEVEL</font>'; print "$refwin"; echo '<h2>Current Competitions:</h2> '; print "Referal competition. <table width=75% cellspacing=1 class='table'> <tr> <td>[url='competition.php?action=referal']REFERALS[/url]</td></tr></table>"; switch($_GET['action']) { case "referal": hof_ref(); break; } function hof_ref() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest number of referals. <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th><font color=grey>Pos</font></th> <th><font color=grey>User</font></th> <th><font color=grey>Level</font></th></tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 AND u.user_level != 2 $myf ORDER BY level DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t{$r['level']}$et</td> </tr>"; } print "</table>"; } Special thanks to Dazza as he helped me with a lot of it.
-
[mccode] Buy A House With Level Requirements !
gurpreet replied to ColdK's topic in General Discussion
Re: [mccode] Buy A House With Level Requirements ! if($ir['hLevel'] > $ir['level'] ) { print "You Are Not The Level Required Yet"; } else { $db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']} WHERE userid=$userid"); print "You Baught {$np['hNAME']} ."; } } -
[mccode] Buy A House With Level Requirements !
gurpreet replied to ColdK's topic in General Discussion
Re: [mccode] Buy A House With Level Requirements ! WOWOWOWO is it just me or is this totally wrong? if($ir['hLevel'] == $ir['level'] ) { print "You Are Not The Level Required Yet"; } else { $db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']} WHERE userid=$userid"); print "You Baught {$np['hNAME']} ."; } } If the house level equals your level, you are NOT required level? I think you got it the wrong way round. -
[mccode] Buy A House With Level Requirements !
gurpreet replied to ColdK's topic in General Discussion
Re: [mccode] Buy A House With Level Requirements ! Same here, I set the level to 50 for 1 house, and people under 50 can buy it. -
Re: Referal in HOF Pog1: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/*******/public_html/competition.php on line 3 $refwin = mysql_num_rows(mysql_query("SELECT * FROM referals WHERE refREFER={$r['userid']}")); is line 3
-
Re: Referal in HOF $refwin = mysql_query("SELECT * FROM referals WHERE refREFER={$r['userid']}"); {echo '$refwin';} When I do that, it echos "$refwin" not the database info. Any ideas?
-
Re: Referal in HOF I dunno..I got that bit from the original halloffame but I need to edit it.
-
OK so I'm tryna add referals in HOF. I got this from the Viewuser: $rr=$db->query("SELECT * FROM referals WHERE refREFER={$r['userid']}"); I want to make it just like HOF level and stuff, but for referals. $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 AND u.user_level != 2 $myf ORDER BY referals DESC,userid ASC LIMIT 20"); That doesn't work. I need it to get info from 2 tables but in 1 query...Help would be good :)
-
Re: Jail reason/Crime fail? Bump! it auto truncates..Any ways to fix this?
-
Re: Prob with max stats What would happen if you change it to an int? Would it mess up?
-
Re: New banner New banner, which is better? This or the one in my first post. My game is on gangster/wars and stuff.
-
McCodes - Banners for 3 Pounds - PAYPAL ONLY
gurpreet replied to CainFool's topic in General Discussion
Re: McCodes - Banners for 3 Pounds - PAYPAL ONLY Exactly..I mean it takes literally 2-3 seconds.. -
Re: [v2]Assassin.php[v2] Same...I'll +1 whoever can do this properly
-
Re: Referals Logs also, there is no link my staff panel or anything.
-
Re: Referals Logs Are the first 2 needed? The 2nd one just takes out the query to give crystals.. Easier to read now! open explore.php Find print "</td></tr></table> This is your referal link: http://{$domain}/register.php?REF=$userid Every signup from this link earns you two valuable crystals!"; Replace With print "</td></tr></table> This is your referal link: http://{$domain}/register.php?REF=$userid Every signup from this link earns you two valuable crystals when they reach level 3!"; open register.php Find if($_POST['ref']) { require "global_func.php"; $db->query("UPDATE users SET crystals=crystals+2 WHERE userid={$_POST['ref']}"); event_add($_POST['ref'],"For refering $username to the game, you have earnt 2 valuable crystals!",$c); $db->query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')"); } Replace With if($_POST['ref']) { require "global_func.php"; event_add($_POST['ref'],"For refering $username to the game, you will earn 2 valuable crystals when they become level 3!"); mysql_query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$ip','0')"); } open staff_logs.php Find case 'stafflogs': view_staff_logs(); break; Add After case 'referals': referals(); break; case 'credit': credit(); break; Find default: print "Error: This script requires an action."; break; } Add After function credit() { global $db,$ir,$c,$h,$userid; if(!$_GET['credited'] || !$_GET['credit']) { die("Error!"); } $credited=$_GET['credited']; $credit=$_GET['credit']; $db->query("UPDATE referals SET refCREDITED='1' WHERE refID={$_GET['credited']}"); $db->query("UPDATE users SET crystals=crystals+2 WHERE userid={$_GET['credit']}"); print "Credited!"; } function referals() { global $db,$ir,$c,$h,$userid; print "<h3>Referal Logs</h3> <table width=100% border=0 class=textbox> <tr> <th>OK?</th> <th>CREDIT!</th> <th>ID</th> <th>Time</th> <th>Refered by</th> <th>Person referred</th> <th>Multi?</th> <th>Actions</th> <th>Level</th> <th>Credited?</th> </tr>"; $q=$db->query(" SELECT rx.*,u1.username as sender, u2.username as sent FROM referals rx LEFT JOIN users u1 ON rx.refREFER=u1.userid LEFT JOIN users u2 ON rx.refREFED=u2.userid WHERE refID > 0 ORDER BY rx.refID DESC "); //refCREDITED=0 AND while($r=mysql_fetch_array($q)) { $qa=$db->query("SELECT u.*,us.*,c.*,h.*,g.*,f.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN cities c ON u.location=c.cityid LEFT JOIN houses h ON u.maxwill=h.hWILL LEFT JOIN gangs g ON g.gangID=u.gang LEFT JOIN fedjail f ON f.fed_userid=u.userid WHERE u.userid={$r['refREFED']}"); $ra=$db->fetch_row($qa); if($r['refREFERIP'] == $r['refREFEDIP']) { $m="<span style='color:red;font-weight:800'>[b]Yes[/b]</span>"; } else { $m="No"; } if($r['refCREDITED'] == 0) { $ma="<span style='color:red;font-weight:800'>[b]No[/b]</span>"; } else { $ma="<span style='color:green;font-weight:800'>[b]Yes[/b]</span>"; } if($ra['level'] > 2) { $mp="<span style='color:green;font-weight:800'>[b]Yes[/b]</span>"; } else { $mp="<span style='color:red;font-weight:800'>[b]No[/b]</span>"; } if($mp == $ma) { $mb="<span style='color:red;font-weight:800'>[b]No[/b]</span>"; } else { $mb="<span style='color:green;font-weight:800'>[b]Yes[/b]</span>"; } print " <tr> <td>$mb</td> <td>[[url='staff_logs.php?action=credit&credit={$r[']CREDIT![/url]]</td> <td>{$r['refID']}</td> <td>" . date("F j, Y, g:i:s a",$r['refTIME']) . "</td> <td>[url='viewuser.php?u={$r[']{$r['sender']}[/url] [{$r['refREFER']}] (IP: {$r['refREFERIP']}) </td> <td>[url='viewuser.php?u={$r[']{$r['sent']}[/url] [{$r['refREFED']}] (IP: {$r['refREFEDIP']}) </td> <td>$m</td> <td> [[url='jailuser.php?userid=={$r[']Jail-Referer[/url]] [[url='jailuser.php?userid=={$r[']Jail-Refered[/url]] </td> <td>$mp</td> <td>$ma</td> </tr>"; } print "</table>"; } Easier to read now.
-
Re: Code for capped EXP? Yeah I know, but lots of people on my game are say level 100-200 with total stats of 1k...People can get that so quickly and just level up too fast.
-
OK so I have no idea how to do this, I was on my brothers account on my game testin some stuff, and I attacked someone like 50 levels higher and won because his stats are low. I left them, and got like 9000% exp, which is at least 25 levels...Which means you can be level 1000 in a day (maybe not a day but you know what i mean) So is there any code that can cap this to say 75% exp?
-
McCodes - Banners for 3 Pounds - PAYPAL ONLY
gurpreet replied to CainFool's topic in General Discussion
Re: McCodes - Banners for 3 Pounds - PAYPAL ONLY Yeah...Photoshop can simply do that too. Outer glow the text a bit, gradient aswell in blending options. -
Re: New banner Yeah the original image was like 50x50...I'll make a new banner.
-
Re: Shops Item Quantity? Why do that? Maybe start off like 500 defaultQTY why not use a rand() like: $QuantRand = rand(100, 250); $AddQuant = sprintf("UPDATE `shops` SET `QTY` = ('%u')"); $db->query ($AddQuant); Reason Why? Then you don't have a definite QTY that comes back. Personally add it to something which would suit your games economy.. If you think about it, in real life, shops get a certain amount of stock every certain amount of days, so for mine when it's done, it would get say 100 of each item every 3 or 4 days. Also what does the %u do?
-
Re: Shops Item Quantity? I know this is wrong but here's my best attempt. SQL queries ALTER TABLE 'shops' ADD 'defaultQTY' (int)11 NOT NULL default(50); ALTER TABLE 'shops' ADD 'QTY' (int)11 NOT NULL; 2) Can't do yet. 3) For Cron_hour.php $db->query("UPDATE shops SET QTY = QTY =>defaultQTY "); Query is totally wrong but yea, the QTY= QTY=> is supposed to mean set the current QTY to the defaultQTY. Didn't know about the last bit.