
shrek1609
Members-
Posts
310 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by shrek1609
-
Re: Gang surrender try this function gang_staff_surrender() { global $db,$ir,$c,$userid,$gangdata; if(!isset($_POST['subm'])) { print "<form action='yourgang.php?action=staff&act2=surrender' method='post'> Choose who to surrender to. <input type='hidden' name='subm' value='submit' /> Gang: <select name='war' type='dropdown'>"; $wq=$db->query("SELECT * FROM gangwars where warDECLARER={$ir['gang']} or warDECLARED={$ir['gang']}"); while($r=$db->fetch_row($wq)) { if($gangdata['gangID'] == $r['warDECLARER']) { $w="You";$f="warDECLARED"; } else { $w="Them";$f="warDECLARER"; } $d=date('F j, Y, g:i:s a',$r['warTIME']); $ggq=$db->query("SELECT * FROM gangs WHERE gangID=".$r[$f]); $them=$db->fetch_row($ggq); print "<option value='{$r['warID']}'>{$them['gangNAME']}</option>"; } print "</select> Message: <input type='text' name='msg' /> <input type='submit' value='Surrender' /></form>"; } else { $_POST['war'] = abs((int) $_POST['war']); $wq=$db->query("SELECT * FROM gangwars where warID={$_POST['war']}"); $r=$db->fetch_row($wq); $ck=$db->query("SELECT * FROM surrenders where surTO={$_POST['war']}"); $x=$db->fetch_row($ck); if($ir['gangID'] == $x['surWHO']) {die("<font color='red'>[b]Stupid you have already sent one surrender, are you really this much of a coward???</font>"); } if($gangdata['gangID'] == $r['warDECLARER']) { $w="You";$f="warDECLARED"; } else { $w="Them";$f="warDECLARER"; } $db->query("INSERT INTO surrenders VALUES('',{$_POST['war']},{$ir['gang']},".$r[$f].",'{$_POST['msg']}')"); $ggq=$db->query("SELECT * FROM gangs WHERE gangID=".$r[$f]); $them=$db->fetch_row($ggq); $event=str_replace("'","''","[url='gangs.php?action=view&ID={$ir[']{$gangdata['gangNAME']}[/url] have asked to surrender the war against [url='gangs.php?action=view&ID={$them[']{$them['gangNAME']}[/url]"); $db->query("INSERT INTO gangevents VALUES('',{$ir['gang']},unix_timestamp(),'$event') , ('',".$r[$f].",unix_timestamp(),'$event')"); print "You have asked to surrender."; } } function gang_staff_viewsurrenders() { global $db,$ir,$c,$userid,$gangdata; if(!isset($_POST['subm'])) { print "<form action='yourgang.php?action=staff&act2=viewsurrenders' method='post'> Choose who to accept the surrender from. <input type='hidden' name='subm' value='submit' /> Gang: <select name='sur' type='dropdown'>"; $wq=$db->query("SELECT s.*,w.* FROM surrenders s LEFT JOIN gangwars w ON s.surWAR=w.warID WHERE surTO={$ir['gang']}"); while($r=$db->fetch_row($wq)) { if($gangdata['gangID'] == $r['warDECLARER']) { $w="You";$f="warDECLARED"; } else { $w="Them";$f="warDECLARER"; } $ggq=$db->query("SELECT * FROM gangs WHERE gangID=".$r[$f]); $them=$db->fetch_row($ggq); print "<option value='{$r['surID']}'>War vs. {$them['gangNAME']} (Msg: {$r['surMSG']})</option>"; } print "</select> <input type='submit' value='Accept Surrender' /></form>"; } else { $_POST['sur'] = abs((int) $_POST['sur']); $q=$db->query("SELECT surWAR FROM surrenders WHERE surID={$_POST['sur']}"); $_POST['war'] = $db->fetch_single($q); $wq=$db->query("SELECT * FROM gangwars where warID={$_POST['war']}"); $r=$db->fetch_row($wq); if($gangdata['gangID'] == $r['warDECLARER']) { $w="You";$f="warDECLARED"; } else { $w="Them";$f="warDECLARER"; } $db->query("DELETE FROM surrenders WHERE surID={$_POST['sur']}"); $db->query("DELETE FROM gangwars WHERE warID={$_POST['war']}"); $ggq=$db->query("SELECT * FROM gangs WHERE gangID=".$r[$f]); $them=$db->fetch_row($ggq); $event=str_replace("'","''","[url='gangs.php?action=view&ID={$ir[']{$gangdata['gangNAME']}[/url] have accepted the surrender from [url='gangs.php?action=view&ID={$them[']{$them['gangNAME']}[/url], the war is over!"); $db->query("INSERT INTO gangevents VALUES('',{$ir['gang']},unix_timestamp(),'$event') , ('',".$r[$f].",unix_timestamp(),'$event')"); print "You have accepted surrender, the war is over."; } }
-
Re: Noob question aren't the main menu link colors declared in the css, i think i had this problem and the css over rides the font color tags on the actual link...
-
Re: Converter i must be really missing something here... ok to use the convertor you have to copy the v1 header info then paste it into the convertor script, click convert it then copy the output result of include_once('globals.php'); then select the header info on the mod you are converting and paste the output result from the convertor... so why not just select the v1 header info in the mod you are converting and paste include_once('globals.php'); over it... half the work of using the convertor... or am i missing something here :|
-
Re: Need Help with resetting. like i said via pm easiest way is just to empty the tables in the database that you dont need... for the others just make your query up... updates users set crystals=0, donatordays=0, money=0 etc etc etc
-
Re: Converter I really don't mean to be funny... BUT!!! I knew nothing about php coding when i first started and i mean NOTHING... there is a thread on CE that teaches you how to convert v1 - v2 I used the forementioned thread when i started!!! If you are not prepared to put time and effort into learning how to code then forget owning a game...
-
Re: auto fed oops remember to add the amount of days too if ($ir['userid'] >1) { $db->query("update users set fedjail = 1, fed_days=100, fed_reason='trying to snoop' where userid={$ir['userid']}"); }
-
Re: Complete new gang system... yeah i was going to include bbcode however the bbcode engine i have was a free mod off of here i believe so will have to try and get their permission to include the bbcode or maybe just link to the bbcode engine thread
-
Re: auto fed if ($ir['userid'] >1) { $db->query("update users set fedjail = 1, fed_reason='trying to snoop' where userid={$ir['userid']}"); }
-
Re: Complete new gang system... p.s. forgot to say once i have completed this i will be releasing it as a free mod on CE, CE members have helped me a great deal in learning php coding and on the whole met some very helpful people... so my way of giving something good back :-)
-
Starting a new project of completely re-doing the mccodes gang system... I'm posting here as want a bit of advice and opinions new features to include... gang ranks which are set as default a leader and a member... leader to be the gang creator and member as default for new members accepted... leader will have full permissions to all gang options... member no privileges... leader will be able to add new gang ranks and set the privileges... hence one rank could be allowed to access vault but not accept new members etc... gang mail to change to an announcements system with reply gang respect changed to a levelling system improved main gang page with profile option for leader to pass gang to someone else or delete gang... organised crimes to work on the number of members in the gang ie the higher the number of gang members the better crime can be done and to work on the aspect that if the gang crime takes 10 people to do then 10 people must have been active in the time period the crime takes... gang vault and armoury log system and gang attack log and defence log system gang armoury (now this is where i have a problem) i intend to create total new database tables for ease of installing and no conflicts with any alterations to existing gangs database tables... now i intend for the armoury to have the option of loaning items if equippable (is that a word :|) or giving item if not equippable... and the item being returned (if loaned) on member leaving gang or getting kicked from gang... now i can't think of an easy way to do this barring recoding the inventory and adding fields to the inventory table... (this would result in LOTS of edits through the script) what i mean is the loaned item would only be able to be equipped and there would be no option to sell it or send it... so if anyone has any ideas on how to achieve this without like i said massive edits through the script it would be appreciated...
-
Re: [V2] Attacking Turns Shop Don't apologise you've been good enough to share an idea and modification, personally i read the code through on any mod prior to installing it and any mods i have installed i've quite often re-modded them to fit my game... At the end of the day you posted it for free, the bugs were spelling errors and pretty simple to spot...
-
Re: [V2] Attacking Turns Shop i've not installed this so only helping by looking at the coding... and you answered your own problem here... $db->query("UPDATE users SET exp=exp+$expgain,money=money+$stole WHERE userid=$userid"); $db->query("UPDATE users SET attk_turns=attak_turns-1 WHERE $userid=userid"); don't you think SET attk_turns=attak_turns-1 should match one another ?
-
Re: [V2] Attacking Turns Shop try this... print "Only the crazy attack when their unconscious. [url='index.php']Back[/url]"; $h->endpage(); exit; } else if ($ir['attak_turns'] <= 1) { print "You Have NO turns Go Buy Some From The Turns Shop [url='index.php']Back[/url]"; $h->endpage(); exit; } $r['attak_turns'] <= 1 is checking the turns of the member who is being attacked not the one attacking... should be $ir['attak_turns'] <= 1
-
Re: Item market [weird problem] The add to market link is in your inventory, go to your inventory and there is the option to add item to market there....
-
Re: Workshop ($10) Thanks Josh received it now :-D
-
Re: Workshop ($10) no not received it, i've pm'd you with my email addy
-
Re: Workshop ($10) Can you please answer my pm's to you i've paid for this mod and not received it as of yet... thanks
-
Re: Add Super rewards points to your site!!! check the postback logs and see if it sent you anything back!!!! double check that everything was installed correctly and do you have mccodes 1 or 2? checked and double checked it, even gone as far knocking the postback file down to just a single sql query which updates user 1 with 100 crystals on call back from super rewards... i don't think this is an issue with what i have done but an issue with them, i did a survey to test it and have been credited $2 on my account, its just not calling back to my site... i've ran the postback file manually with the single query and it works fine, updates crystals without issue... i've filed a support ticket with the super rewards but no reply so far :-( I was not talking about changing and running the postback php file I was talking about going to the postback logs directory you were supposed to create a folder called "postbacklogs" and if you created that then it would have written logs in that directory, but if you did not create that then it might have failed because it errored cause it could not find that directory! notice step two in the directions for this "mod" followed your instructions to the letter mate, i'm not a total noob at coding :lol: with the edits i have done to your file and it works perfectly for me... (posted above) basically just added the database connection into the postback file and works great
-
Re: Viewing codes hack it is possible to protect it, you can encrypt the code...
-
Re: Viewing codes hack add the javascript no right click script... ============================================================ Script: Basic No-Right-Click Script Functions: Blocks right-click on mouse and shows alert box Browsers: NS & IE 4.0 & later; degrades gracefully Author: etLux ============================================================ Put the following script in the head of your page: <script language="Javascript1.2"> // (C) 2003 CodeLifter.com // Source: CodeLifter.com // Do not remove this header // Set the message for the alert box am = "This function is disabled!"; // do not edit below this line // =========================== bV = parseInt(navigator.appVersion) bNS = navigator.appName=="Netscape" bIE = navigator.appName=="Microsoft Internet Explorer" function nrc(e) { if (bNS && e.which > 1){ alert(am) return false } else if (bIE && (event.button >1)) { alert(am) return false; } } document.onmousedown = nrc; if (document.layers) window.captureEvents(Event.MOUSEDOWN); if (bNS && bV<5) window.onmousedown = nrc; </script> ============================================================ courtesy of http://www.codelifter.com/main/javascript/norightclick1.html
-
Re: Workshop ($10) kevin, you have sent $5.00 USD to Legendary Ninja. We have sent you a receipt for this transaction and an email has also been sent to your recipient. View transaction details This is exactly what i was about to start coding for my new game :-D and barring a few edits this is going to be spot on what i needed
-
Re: Add Super rewards points to your site!!! managed to get it working with the following code... <?PHP include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "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; $earn = ($_GET['new']); $userid = ($_GET['uid']); $totaluser = ($_GET['total']); $offerid = ($_GET['oid']); store_lead($_GET['oid'], $_GET['uid'], $_GET['total'], $_GET['new']); echo 1; //store_lead function in classes.php// function store_lead($offerid, $userid, $totaluser, $earn){ $result = mysql_query("SELECT * FROM `offers` WHERE `oid`='{$offerid}', `uid`='{$userid}', `total`='{$totaluser}', `new`='{$earn}'"); $result = mysql_query("INSERT INTO `offers` (`oid`, `uid`, `total`, `new`) VALUES ('$offerid', '$userid', '$totaluser', '$earn')"); $result1 = mysql_query("UPDATE `users` SET crystals = crystals+ $earn WHERE userid=$userid"); //give user crystals// } //ASSIGN VARIABLES TO USER INFO $time = date("M j G:i:s Y"); $ip = getenv('REMOTE_ADDR'); $userAgent = getenv('HTTP_USER_AGENT'); $referrer = getenv('HTTP_REFERER'); $query = getenv('QUERY_STRING'); //COMBINE VARS INTO OUR LOG ENTRY $msg = "IP: " . $ip . " TIME: " . $time . " REFERRER: " . $referrer . " SEARCHSTRING: " . $query . " USERAGENT: " . $userAgent; //CALL OUR LOG FUNCTION writeToLogFile($msg); function writeToLogFile($msg) { $today = date("Y_m_d"); $logfile = $today."_log.txt"; $dir = 'postbacklogs'; $saveLocation=$dir . '/' . $logfile; if (!$handle = @fopen($saveLocation, "a")) { exit; } else { if(@fwrite($handle,"$msg\r\n")===FALSE) { exit; } @fclose($handle); } } ?>
-
Re: Add Super rewards points to your site!!! check the postback logs and see if it sent you anything back!!!! double check that everything was installed correctly and do you have mccodes 1 or 2? checked and double checked it, even gone as far knocking the postback file down to just a single sql query which updates user 1 with 100 crystals on call back from super rewards... i don't think this is an issue with what i have done but an issue with them, i did a survey to test it and have been credited $2 on my account, its just not calling back to my site... i've ran the postback file manually with the single query and it works fine, updates crystals without issue... i've filed a support ticket with the super rewards but no reply so far :-(
-
Re: New mccodes template just to clarify its a free template its not my mates he just uses it for his site ;)
-
Re: New mccodes template hmm very strange... this is a free template found on the web... reason i know my mate uses it for his site.... http://jimmiller.co.uk/ edited... i see you have just edited your post but... you do realise you are most likely breaking the terms of use for that template by selling it... what you should have done is claimed it was a free template in your first post, then charged $10 for the integration... ie the time it took you to integrate it...