Infamous cTz Posted June 28, 2010 Posted June 28, 2010 anyone have any type of top gangs in the city script ? maybe just something ordered by the number of members in the city... ?( Quote
Maniak Posted June 28, 2010 Posted June 28, 2010 For the top gangs: $gang = mysql_fetch_object(mysql_query("SELECT * FROM `gangs` ORDER BY `gang_rep` ASC LIMIT 5")); - you will need to change the db columns to w/e yours are.. For the top gangs in the city: I don't know. Quote
Zero-Affect Posted June 29, 2010 Posted June 29, 2010 i'd of even said gang_rep lol would you not need something to grab the presidents location and it being the same as the users? Quote
Curt Posted June 30, 2010 Posted June 30, 2010 Yes you are correct Crimgame, otherwise it would simply show the overall top gangs... I like this idea so i may create this for my game...I have a custom gang system so my version would not help you guys but ill see about posting some code for the default system as well...this should be a simple task..:P Cheers Quote
Faz` Posted July 3, 2010 Posted July 3, 2010 Correct me if I am wrong, but wouldn't it be impossible to order gangs via the city they are in without adding/modifying the gangs? For example, President could be in Location1, Vice in Location 2, and various other members spread out across different cities? Quote
Zero-Affect Posted July 3, 2010 Posted July 3, 2010 Faz you do have a valid point i think a good solution would be when they setup a gang (if you have a existing game make the gang base in default location) it allows the president(founder) to set a location of the base. Allow them to change location via gang staff panel (only allow president to) and charge them like 10k or something (count the times they change and then do #times changes * 10k). Quote
Infamous cTz Posted July 10, 2010 Author Posted July 10, 2010 so we need to count the number of gangs in the city first right.... then count the players in those gangs..... ?( maybe i will just do top gangs by respect lol even them im confused on the how it will work per city... i only get errors so my code wont even help lol il work on it Quote
sniko Posted July 15, 2010 Posted July 15, 2010 <?php $query = mysql_query("SELECT `id`,`president` FROM `gangs` ORDER BY `respect` DESC LIMIT 5"); $rank = 0; while($r = mysql_fetch_array($query)) : $rank++; $mems = mysql_fetch_array(mysql_query("SELECT COUNT(`userid`) AS `u` FROM `users` WHERE `gang`={$r['id']}")); $loc = mysql_fetch_array(mysql_query("SELECT `location` FROM `users` WHERE `userid`={$r['president']}")); $loca = mysql_fetch_array(mysql_query("SELECT `cityname` FROM `cities` WHERE `cityid`={$loc['location']}")); //start Grammar if($rank == 1) { $g = "st"; } if($rank == 2) { $g = "nd"; } if($rank == 3) { $g = "rd"; } if($rank == 4 || $rank == 5) { $g = "th"; } echo "The {$rank}<sup>$g</sup> is in {$loca['cityname']} with ".number_format($mems['u'])." members"; endwhile; ?> 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.