18.09.2011, 13:45
pawn Код:
dcmd_createhouse(playerid, params[])
{
new Float:X,Float:Y,Float:Z, price;
if (PlayerInfo[playerid][pAdmin] < 10) return SendClientMessage(playerid,COLOR_WHITE,"You're not authroized to use this command !");
if(sscanf(params, "d", price)) return SendClientMessage(playerid, COLOR_WHITE, "[{EE5555}USAGE{FFFFFF}]: /createhouse [price]");
GetPlayerPos(playerid, X,Y,Z);
CreateHouse(price, X, Y, Z);
return 1;
}
If I just type /createhouse, it returns the [USAGE] message, but if I type /createhouse 10000 for example, it returns unknown command.
CreateHouse function :
pawn Код:
stock CreateHouse(Cost, Float:EnterX, Float:EnterY, Float:EnterZ)
{
new house;
house = GeneralSettings[LoadedHouses];
HouseInfo[house][hValue] = Cost;
HouseInfo[house][hEntrancex] = EnterX;
HouseInfo[house][hEntrancey] = EnterY;
HouseInfo[house][hEntrancez] = EnterZ;
GeneralSettings[LoadedHouses]++;
return 1;
}