Problem cmd
#1

Deleted
Reply
#2

Try adding this right after line 18, before line 19 (going by the line-numbers of the pastebin)
Код:
if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "   This amount isnt valid!! you scoundrel!");
Reply
#3

pawn Код:
CMD:getproducts(playerid, params[])
{
        new string[128], amount, price;
        if(sscanf(params, "d", amount)) return SendClientMessageEx(playerid, COLOR_WHITE, "Perdorimi: /getproducts [vlera]");
 
        if(!PlayerInfo[playerid][pBusiness]) return SendClientMessage(playerid, COLOR_GREY, "You don't own a business, to /getproducts");
        if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1030.8898,-1451.5533,13.5546))
        {
            SendClientMessageEx(playerid, COLOR_GRAD2, " You are not at the products pickup to /getproducts");
            return 1;
        }
        if ( BizInfo[PlayerInfo[playerid][pBusiness]][bSupplies] >= 500)
        {
                SendClientMessageEx(playerid, COLOR_GRAD2, " You have reached your Products limit of 500 Products.");
                return 1;
        }
        price = amount * 15;
        if(Products < amount) return SendClientMessageEx(playerid, COLOR_GREY, "   This Products pickup doesn't have that much product!");
        if(amount > 0 || amount < 999999) return SendClientMessageEx(playerid, COLOR_GREY, "   FUCKING BITCH!"); // YEAH!! MAX IS : 999999
        if(GetPlayerCash(playerid) > price)
        {
                format(string, sizeof(string), "* You bought %d products for $%d.", amount, price);
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
                GivePlayerCash(playerid, -price);
                BizInfo[PlayerInfo[playerid][pBusiness]][bSupplies] += amount;
                Products -= amount;
                format(string, sizeof(string), "Packages Dropoff\n{FFFF00}/getproducts to get a product\nAvailable Products: %d/10000", Products);
                UpdateDynamic3DTextLabelText(ProductsText, COLOR_RED, string);
        }
        else
        {
                SendClientMessageEx(playerid, COLOR_GREY, "   You cant afford the Products!");
                return 1;
        }
        return 1;
}
Reply
#4

This looks scary:
0 =< amount >= 999999

You sure that does what you want?, to me that reads as:
If 0 is less than or equal to amount, is greater than or equal too 999999
Wich will never be true. (and has a invalid less than)
Reply
#5

Thank u guys , I will test it
Reply
#6

Always a pleasure
Reply
#7

Quote:
Originally Posted by Suicidal.Banana
Посмотреть сообщение
This looks scary:
0 =< amount >= 999999

You sure that does what you want?, to me that reads as:
If 0 is less than or equal to amount, is greater than or equal too 999999
Wich will never be true. (and has a invalid less than)
sory" :v I justify it
Reply
#8

Still wrong swap the less and greater than symbols, now your giving the warning message to everybody that stays within the legal range

Redcode; how are you getting along? did you get it to work how you want?
Reply
#9

Don't work man
Reply
#10

Show us what you have now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)