Why does this not work
#1

Well when i do /sellfish and put a number under 0 in it sends the money to the person even though it is under 0 how can i fix this

Help is appreciated

pawn Код:
command(sellfish, playerid, params[])
{
    new fish, string[128];
    if(sscanf(params, "d", fish))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /sellfish [amount]");
    }
    else
    {
        if(Businesses[Player[playerid][InBusiness]][bType] == 1)
        {
                if(fish >= Player[playerid][CollectedFish])
                {
                    SendClientMessage(playerid, WHITE, "You don't have that many fish.");
                }
                else
                {
                    new Calculation = fish*6;
                    Player[playerid][Money] += Calculation;
                    format(string, sizeof(string), "You have earned $%d for %d fish.", Calculation, fish);
                    SendClientMessage(playerid, WHITE, string);
                    Player[playerid][CollectedFish] -= fish;
                }
        }
    }
    return 1;
}
Help is appreciated
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)