14.07.2013, 19:02
Hello, I got this command scripted:
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?
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?