PHP Code:if (is_numeric($amount) > $stat[ap]) {
echo "You can't use more than you have";
exit;
} elseif (is_numeric($amount) && $amount > 0) {
// code here
}










Alright this is from my game i am having a major problem with it
AP Box
Rules:
No more than u have
No neg numbers
It will use all the AP but u cant use all u always have to have 1 remaining the script wont allow u to use it all?PHP Code:
if ($amount >= $stat[ap])
print "You cannot use more than you have";
exit;
Any ideas
PHP Code:if (is_numeric($amount) > $stat[ap]) {
echo "You can't use more than you have";
exit;
} elseif (is_numeric($amount) && $amount > 0) {
// code here
}
is_numeric returns a boolean value, so not quite ...
PHP Code:<?php
if( $amount >= $stat['ap'] )
{
print( "You cannot use more than you have" );
exit;
}
elseif( $amount < 0 )
{
print( "You cannot use negative numbers" );
exit;
}
elseif( ( $stat['ap'] - $amount ) < 1 )
{
print( "You must leave at least 1" );
exit;
}
else
{
// Code here ...
}
?>
(\__/) Joe Watkins
(='.'=) Software Architect
(")_(") http://pthreads.org
Copy and paste bunny into your sig, help him gain world domination.










ty krakjoe but you might have mis understood due to my lack of elaberation and proper explanation
the problem is
AP: 3 [USE]
when they type in 3 to use it in the ap box it wont allow it it only allows the most to be all but 1 it wont allow all to be used that is my problem
I still don't get it, I was just guessing and fixing what stuff posted ...
(\__/) Joe Watkins
(='.'=) Software Architect
(")_(") http://pthreads.org
Copy and paste bunny into your sig, help him gain world domination.










Once my server goes back online i will allow u to see the error










shadowofdemise.uni.cc
Join and goto Overview -> AP and try to use all 3 points u have and then try 2
Bookmarks