Jump to content

Is this code correct?


karimali831

Recommended Posts

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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.