karimali831 Posted February 20, 2010 Share Posted February 20, 2010 function validmembers($clanID, $cupID) { $ergebnis = safe_query("SELECT typ FROM ".PREFIX."cups WHERE ID = '".$cupID."'"); $ds=mysql_fetch_array($ergebnis); $min_anz = strstr($ds['typ']); $ergebnis2 = safe_query("SELECT clanID FROM ".PREFIX."cup_clan_members WHERE clanID = '".$clanID."'"); $anz_mem = mysql_num_rows($ergebnis2); if($anz_mem >= $min_anz) return true; else return $false; } Basically, a team can not signup to a cup if they don't have X (typ) amount of members in their team. typ = 5on5, 4on4 oetc so you need that much members before joining a cup. Screenshots to help you understand. My problem is team can join cup even though they don't have enough members? When typ = 5, still don't work. [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
karimali831 Posted February 20, 2010 Author Share Posted February 20, 2010 Sorry was meant to say I keep getting the error. Quote Link to comment Share on other sites More sharing options...
karimali831 Posted February 21, 2010 Author Share Posted February 21, 2010 elseif($ds['typ'] >= $anz_mem This code is greater than. How do I make it equal or greater? Quote Link to comment Share on other sites More sharing options...
karimali831 Posted February 21, 2010 Author Share Posted February 21, 2010 I tried ($anz_mem <= $ds['typ']) But no help.. if I can get $ds['typ'] -1 that would be perfect but not sure how to do this? Quote Link to comment Share on other sites More sharing options...
mattwal Posted February 21, 2010 Share Posted February 21, 2010 Hello, I'm not sure if i can help help with the coding problem as I'm only 1 step up from a beginner. But it sounds to me like if you already have your members registered individually (Their own separate accounts) you could then make some sort of page were they can start a clan page; and have their separate account link to that clan. Then (this being about your question) have a battle option where it will set-up a match on a specific day/time and how many players there is going to be 4v4/5v5. In your "Battle" validation script your going to have to perform a check to make sure that there are enough players in each clan. IMO in the battle form your gonna have to carry over both clan id values (i believe) and then you could use that in some sort of sql statement to check on how many player are signed up for the match... I hope this help some. Quote Link to comment Share on other sites More sharing options...
karimali831 Posted February 21, 2010 Author Share Posted February 21, 2010 Yes, that's right but I managed to figure it out elseif($anz_mem+1 <= $ds['typ']) Quote Link to comment Share on other sites More sharing options...
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.