cmd sscanf problem
#5

Quote:
Originally Posted by iThePunisher
Посмотреть сообщение
all your problem is here, you have blocked the command in this line
pawn Код:
else {
        SendClientMessage(playerid, C_SYNTAX, "Error:{FFFFFF} Invalid action.");
    }
try this
pawn Код:
CMD:ahouse(playerid, params[])
{
    if(PlayerData[playerid][AdminLevel] < 6) return SendUnathorizedMessage(playerid);
   
    if(strcmp(params, "create", true) == 0)
    {
        new level, price, id = 0, Float:X, Float:Y, Float:Z, Float:A, string[126],zone[MAX_ZONE_NAME];
        if(sscanf(params, "ii", level, price)) return SendClientMessage(playerid, C_SYNTAX, "Syntax:{FFFFFF} /ahouse create [level] [price]");
        if(level < 1) return SendClientMessage(playerid, C_SYNTAX, "Error:{FFFFFF} House levels must not go below 1.");
        if(price < 50000) return SendClientMessage(playerid, C_SYNTAX, "Error:{FFFFFF} The minimum value of a house is $50,000.");
       
        for(new i = 0; i < sizeof(HouseData); i ++)
        {
            if(HouseData[i][Created] == 0) id = i;
        }
        GetPlayerPos(playerid, X,Y,Z);
        GetPlayerFacingAngle(playerid,A);
        GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
       
        HouseData[id][Entrance][0] = A;
        HouseData[id][Entrance][1] = X;
        HouseData[id][Entrance][2] = Y;
        HouseData[id][Entrance][3] = Z;
        HouseData[id][Created] = 1;
        HouseData[id][SalePrice] = price;
        HouseData[id][ForSale] = true;
        HouseData[id][Owned] = false;
        SetHouseInterior(id, level);
       
        format(string, sizeof(string), "* You just created house %d in %s for %s, don't forget to /house sign.", id, zone, ConvertPrice(price));
        SendClientMessage(playerid, C_CYAN, string);
        return 1;
    }
    return 1;
}
He is correct my do you need to make a else message if all of the messages are in the top of the command?
try to do what he said and check if it works
Reply


Messages In This Thread
cmd sscanf problem - by Jack_Leslie - 13.03.2014, 06:50
Re: cmd sscanf problem - by iThePunisher - 13.03.2014, 07:03
Re: cmd sscanf problem - by Jack_Leslie - 13.03.2014, 07:06
Re: cmd sscanf problem - by Jack_Leslie - 15.03.2014, 03:36
Re: cmd sscanf problem - by DarkLored - 15.03.2014, 04:02
Re: cmd sscanf problem - by Jack_Leslie - 15.03.2014, 10:04
Re: cmd sscanf problem - by Matess - 15.03.2014, 10:24
Re: cmd sscanf problem - by Jack_Leslie - 16.03.2014, 00:46
Re: cmd sscanf problem - by Zeppo - 16.03.2014, 01:16
Re: cmd sscanf problem - by Jack_Leslie - 16.03.2014, 01:21

Forum Jump:


Users browsing this thread: 1 Guest(s)