ID not valid
#1

Basically on the garage system im making, i did a /sellgarage cmd where players can put for sale their garages.

Admins can do /creategarage for creating them. I create a garage, their ID is 1 (which is correct), so the creation part works.

The problem comes with the /sellgarage CMD, even if the garageID exists, it says i've specified an invalid garage ID.

pawn Код:
CMD:sellgarage(playerid, params[])
{
    new id;
   
    new price;

    if(sscanf(params, "di", id, price)) return SCM(playerid, COLOR_BELGREEN, "» [USAGE]: /sellgarage [garage ID] [price]");

    if((id < 1 || id >= MAX_GARAGES) || !GarageInfo[id][garageExists]) return SCM(playerid, COLOR_ERROR, "» You have specified an invalid garage ID.");

    if(GarageInfo[id][garageOwnerID] != Player[playerid][ID]) return SCM(playerid, COLOR_ERROR, "» This garage is not yours.");

    if(!GarageInfo[id][garageOwned]) return SCM(playerid, COLOR_ERROR, "» This garage can't be put for sale because it's unowned.");
   
    if(GarageInfo[id][garagePlayerSellPrice] > 0) return SCM(playerid, COLOR_ERROR, "» This garage is already for sale. If you wish to change the price, you can use /changegarageprice.");

    if((price < 1) || (price > 999999)) return SCM(playerid, COLOR_ERROR, "» Invalid price.");

    PutGarageForSale(playerid, id, price);

    RefreshGarage(id);
    return 1;
}
What the hell is wrong?

garageID is set as AUTO_INCREMENT on database, which increases by 1 everytime i create a new garage with /creategarage.

I've created 1 garage for testing, ID 1, i'm trying to sell it but i get that stupid message "you've specified an invalid garage ID" even if the garage ID 1 exists in the database.
Reply


Messages In This Thread
ID not valid - by SymonClash - 22.02.2019, 10:19
Re: ID not valid - by CherryMond - 22.02.2019, 14:14
Re: ID not valid - by SymonClash - 22.02.2019, 14:17
Re: ID not valid - by TheToretto - 22.02.2019, 14:30
Re: ID not valid - by SymonClash - 22.02.2019, 14:38
Re: ID not valid - by TheToretto - 22.02.2019, 15:05
Re: ID not valid - by SymonClash - 22.02.2019, 19:06
Re: ID not valid - by TheToretto - 22.02.2019, 19:51
Re: ID not valid - by SymonClash - 22.02.2019, 20:39
Re: ID not valid - by TheToretto - 22.02.2019, 21:40
Re: ID not valid - by Pottus - 22.02.2019, 21:54
Re: ID not valid - by TheToretto - 22.02.2019, 22:12
Re: ID not valid - by Pottus - 22.02.2019, 22:58
Re: ID not valid - by SymonClash - 22.02.2019, 23:30
Re: ID not valid - by TheToretto - 23.02.2019, 09:36
Re: ID not valid - by SymonClash - 23.02.2019, 11:05
Re: ID not valid - by TheToretto - 23.02.2019, 12:23
Re: ID not valid - by SymonClash - 23.02.2019, 12:34
Re: ID not valid - by TheToretto - 23.02.2019, 13:46
Re: ID not valid - by SymonClash - 23.02.2019, 14:20
Re: ID not valid - by SymonClash - 24.02.2019, 19:09
Re: ID not valid - by JasonRiggs - 24.02.2019, 19:40
Re: ID not valid - by SymonClash - 24.02.2019, 21:06
Re: ID not valid - by JasonRiggs - 24.02.2019, 21:36
Re: ID not valid - by SymonClash - 25.02.2019, 13:05

Forum Jump:


Users browsing this thread: 1 Guest(s)