[PHP]Problemy z function- własny mod Clanwwars


(Exorf) #1

Witam! Chciałem napisać prosty w obsłudze mod clanwars na stronę www:

<?

function cw($name_a, $www_a, $score_a, $players, $players_a, $score_b, $players_b, $maps){

$name_b='cos tam';

$status=0;

if(!$www_a){$www_a='#';} if(!$score_a){$score_a='?';} if(!$score_b){$score_b='?';} if(!$players){$players='?';}

if(!$players_a){$players_a='?';} if(!$players_b){$players_b='?';} if(!$maps){$maps='?';} if($score_a==$score_b){$cw=$cw+1; $status[1]='blue'; $status[2]='blue';}

elseif($score_a>$score_b){$cw=$cw+1; $lost=$lost+1; $status[1]='red'; $status[2]='blue';}

elseif($score_a<$score_b){$cw=$cw+1; $won=$won+1; $status[1]='blue'; $status[2]='red';}

$cw=''.$name_b.'vs'.$name_a.''.$score_b.'-'.$score_a.''.$players.'vs'.$players.''.$players_a.'vs'.$players_a.'';

return $cw;

}


echo '

| Won/Lost ≈ '.$wl.' | '.$lost.' |

'; ?>[/code] a efekt:
[code]

| PHP Error Message |

Warning : Cannot use a scalar value as an array in /home/a4994325/public_html/clanwars.php on line 10

|
Free Web Hosting
|

vsFS4-144vs4nicka1 nicka2vsnicka1 nicka2

| PHP Error Message |

Warning : Division by zero in /home/a4994325/public_html/clanwars.php on line 19

|
Free Web Hosting
|

Won/Lost ≈ 0

Co jest źle? Czy zmienne $won i $lost będą zapamiętywane (ich wartość będzie wzrastać?) :expressionless: Proszę o pomoc...