Revcms Faction Maker (FalloutRP) (NonHabbo)

Leader

github.com/habbo-hotel
Aug 24, 2012
1,006
267
FIXED! (Just added the column)
Now I need a "faction" and a "frank" changer
 

IntactDev

Member
Nov 22, 2012
399
71
: This is the code that made, but he put the incorrect table and column in the query.

PHP:
<?php
$groupLimit = '5';
$queryGroupAmount = mysql_query("SELECT owner FROM factions WHERE id = '".$_SESSION['user']['id']."'");
$groupAmount = mysql_num_rows($queryGroupAmount);
 
$neededCredits = '500';
$queryCreditAmount = mysql_query("SELECT credits FROM users WHERE id = '".$_SESSION['user']['id']."'");
$creditAmount = mysql_result($queryCreditAmount, 0);
 
if ($groupAmount >= $groupLimit)
{
    if ($creditAmount >= $neededCredits)
    {
        if (isset($_POST['create']))
        {
            $newCreditAmount = $creditAmount - 500;
            mysql_query("INSERT INTO factions(name,owner,official) VALUES('".filter($_POST['name'])."', '".$_SESSION['user']['id']."', '0')");
            mysql_query("UPDATE users SET credits= '".$newCreditAmount."' WHERE id = '".$_SESSION['user']['id']."' ");
            echo 'Faction has been created!';
        }
    }
    else
    {
        $leftCredits = $neededCredits - $creditAmount;
        echo 'You don\'t have enough credits! You atleast need '.$neededCredits.' to create a group. You currently have '.$creditAmount.' credits, that means you still need '.$leftCredits.' credits to create a group.';
    }
}
else
{
    echo 'You already have more then '.$groupLimit.' groups! This means you can not make any more.';
}
?>
 

Users who are viewing this thread

Top