Returning unknown command.
#1

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;
}
Probably a newbie mistake.
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;
}
Reply
#2

How is this code done? I don't think its right to do it likes this, Please use 'Search' Download GarHouse or anyother housing system that might escape you from being time wasting on The New House system.
Reply
#3

Edited
Reply
#4

Probably the Createhouse is wrong. Show us that function.

// I see you updated it.
Reply
#5

Anyone ? I'm in need of this.
Reply
#6

Debug your code.
Reply
#7

Debug ? how excatly.
Reply
#8

Bump
Reply
#9

I am suggesting you again, To use someone's else.

https://sampforum.blast.hk/showthread.php?tid=182435
https://sampforum.blast.hk/showthread.php?tid=283501
http://forum.sa-mp.com/showthread.ph...ghlight=housin
Reply
#10

Hmmm I can't really say as I do it manually with normal conditional branching but it looks ok.

I would assume the setup is incorrect (have you gone through how usage of how this dcmd works?).

Also not really relevant but what is with this habit of people not using { } on single line conditionals, probably not a good habit *shrugs*.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)