lucky3809 Posted January 4, 2011 Posted January 4, 2011 This was requested from this posting Gang Mod V2 What this mod is Leaders of the gang can turn off war so other gangs cant declare on them and they cant declare on other gangs, while having the war option OFF... This has probably been already done, I did not secure this if anything is out of place please feel free to add your own part to this as for I used the original yourgang.php my own gang php is set up differently... Anyhow Here you go Scott and others.. Sql: [mysql]ALTER TABLE `gangs` ADD `waroption` ENUM( 'Off', 'On' ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'Off'; [/mysql] Open yourgang.php Find :function gang_staff() Add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. scroll down to function gang_staff_idx() Find: Change Gang Tag"; Add under it: Toggle War Status Find: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Replace it With: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Find: $h->endpage(); ?> Above Add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. open creategang.php and find: $db->query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'')"); Replace with: $db->query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'',Off)"); And that should be all,enjoy! Quote
J_StrauD Posted January 4, 2011 Posted January 4, 2011 Looks good, I'd like to test it but I don't use mccodes anymore. And I'm not 100% positive, but I think abs(intval()); is more secure. Not totally sure though. Other than that looks good, I like the idea Quote
lucky3809 Posted January 4, 2011 Author Posted January 4, 2011 Thank you, i dont use mccodes either it was just a request from scott, only took 15 minutes to put together was no biggie lol. abs(intval()); could work, I just didnt do any security on it didnt have the time. Quote
Andrewelli Posted March 29, 2011 Posted March 29, 2011 awsome mod would be better if there was a way to see if someone was toggled like when you view someones gang Quote
lucky3809 Posted March 31, 2011 Author Posted March 31, 2011 No problem it's really simple to add lol. Just add this anywhere on the gang.php or whatever page you want it to display on that has gangdata.. if($gangdata['waroption']=="Off"){ echo ' This gang has war option off.'; } else { echo 'This gang has war option on.'; } Quote
Andrewelli Posted March 31, 2011 Posted March 31, 2011 might want to edit crategang.php will cause error look for mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'',0,0)",$c) or die(mysql_error()); Change it to mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'',0,0,'')",$c) or die(mysql_error()); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.