Command results in "Unknown command"
#1

Hello, I got this command scripted:

pawn Код:
CMD:createhouse(playerid, params[])
{
    new type[20], price;
    if(!IsOnDutyAdmin(playerid))
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "You must be on admin duty to use this command!");
        return 1;
    }
    if(sscanf(params, "si", type, price))
    {
        if(PlayerInfo[playerid][pAdmin] >= 1)
        {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: {FFFFFF}/createhouse [type] [price]");
            SendClientMessage(playerid, COLOR_WHITE, "TYPES: small - medium - villa");
        }
    }
    else
    {
        if(strcmp(type, "small", true) == 0)
        {

            new Float:x,Float:y,Float:z;
            GetPlayerPos(playerid,x,y,z);
            new newhouse;
            newhouse = SpawnedHouses += 1;

            HouseInfo[newhouse][EntranceX] = x;
            HouseInfo[newhouse][EntranceY] = y;
            HouseInfo[newhouse][EntranceZ] = z;
            HouseInfo[newhouse][InsideX] = x;
            HouseInfo[newhouse][InsideY] = y;
            HouseInfo[newhouse][InsideZ] = z;
            HouseInfo[newhouse][Owned] = 0;
            HouseInfo[newhouse][Locked] = 0;
            HouseInfo[newhouse][Price] = price;
            HouseInfo[newhouse][AlarmInstalled] = 0;
            HouseInfo[newhouse][DoorRammed] = 0;
            HouseInfo[newhouse][CustomInt] = 0;
            HouseInfo[newhouse][CustomExt] = 0;
            format(HouseInfo[newhouse][Owner], 255, "Nobody");

            new string[255];
            format(string, sizeof(string), "House: ID %d\n FOR SALE\nPrice: %d", newhouse, price);
            HouseInfo[newhouse][hTextID] = CreateDynamic3DTextLabel(string, COLOR_GREEN, HouseInfo[newhouse][EntranceX], HouseInfo[newhouse][EntranceY], HouseInfo[newhouse][EntranceZ]+0.5,30.0, 0);
            Update3DTextLabelText(HouseInfo[newhouse][hTextID], COLOR_GREEN, string);
            SaveHouse(newhouse);
            UpdateHouse(newhouse);
        }
    }
    return 1;
}

When I just type "/createhouse" without parameters or just one, I get the syntax shown: "USAGE: /createhouse [type] [price]"

But when I insert them correctly, and in this case "small" and any price, I get "SERVER: Unknown Command" in-game. What would be the issue with the command?
Reply


Messages In This Thread
Command results in "Unknown command" - by Mado - 14.07.2013, 19:02
Re: Command results in "Unknown command" - by Maime - 14.07.2013, 19:37
Re: Command results in "Unknown command" - by Mado - 14.07.2013, 20:05
Re: Command results in "Unknown command" - by Maime - 14.07.2013, 22:44
Re: Command results in "Unknown command" - by Mado - 15.07.2013, 08:04
Re: Command results in "Unknown command" - by Mado - 15.07.2013, 11:12

Forum Jump:


Users browsing this thread: 2 Guest(s)