SA-MP Forums Archive
Unknown command. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Unknown command. (/showthread.php?tid=393198)



Unknown command. - thefatshizms - 17.11.2012

pawn Код:
CMD:createbiz(playerid, params[])
{
    new Float:pos[3], level, price, inter, payment;
    if(sscanf(params,"iiii", level, price, inter, payment)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "[USAGE]"EMBED_GREEN" /createbiz <level> <price> <interior> <payment>");
    if(inter < 0 || inter > 18) return SendClientMessage(playerid, COLOR_RED, "[ERROR]"EMBED_GREEN" You have entered an invalid interior id. Interiors range from 0-18");
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    for(new id = 0; id < sizeof(HouseI);id++) {
        HouseI[id][X_enter] = pos[0];
        HouseI[id][Y_enter] = pos[1];
        HouseI[id][Z_enter] = pos[2];
        HouseI[id][interior] = inter;
        HouseI[id][Level] = level;
        HouseI[id][Price] = price;
        HouseI[id][Payment] = payment;
        HouseI[id][Owned] = false;
        #if ENTER_TYPE == 1
        HouseI[id][pickup] = CreateDynamicPickup(1274, 1, HouseI[id][X_enter], HouseI[id][Y_enter], HouseI[id][Z_enter], -1, -1, -1, 100.0);
        #endif
    }
    return true;
}
When i use this command ingame it gives me a unkown command message


Re: Unknown command. - -=Dar[K]Lord=- - 17.11.2012

pawn Код:
CMD:createbiz(playerid, params[])
{
    new Float:pos[3], level, price, inter, payment;
    if(sscanf(params,"iiii", level, price, inter, payment)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "[USAGE]"EMBED_GREEN" /createbiz <level> <price> <interior> <payment>");
    if(inter < 0 || inter > 18) return SendClientMessage(playerid, COLOR_RED, "[ERROR]"EMBED_GREEN" You have entered an invalid interior id. Interiors range from 0-18");
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    for(new id = 0; id < sizeof(HouseI);id++)
    {
        HouseI[id][X_enter] = pos[0];
        HouseI[id][Y_enter] = pos[1];
        HouseI[id][Z_enter] = pos[2];
        HouseI[id][interior] = inter;
        HouseI[id][Level] = level;
        HouseI[id][Price] = price;
        HouseI[id][Payment] = payment;
        HouseI[id][Owned] = false;
        #if ENTER_TYPE == 1
        HouseI[id][pickup] = CreateDynamicPickup(1274, 1, HouseI[id][X_enter], HouseI[id][Y_enter], HouseI[id][Z_enter], -1, -1, -1, 100.0);
        #endif
        return 1;
    }
    else return 1;
}
try using this


Re: Unknown command. - park4bmx - 17.11.2012

the return statement is not correct !


Re : Unknown command. - lelemaster - 17.11.2012

Try to debug between each line, in the loop you'll get spam but you'll see where it stops.


Re: Unknown command. - zDivine - 17.11.2012

You need to create a variable to check if the houseid is used or not.

This will go in your biz enum:
pawn Код:
UsedID
In your createbiz command, you need to add this right under where you are checking for all the biz id's:
pawn Код:
if(HouseI[id][UsedID] == 0)
Then inside your command where you are setting the bizz's information, you need to add this:
pawn Код:
HouseI[id][UsedID] = 1;
And under this line:
pawn Код:
HouseI[id][pickup] = CreateDynamicPickup(1274, 1, HouseI[id][X_enter], HouseI[id][Y_enter], HouseI[id][Z_enter], -1, -1, -1, 100.0);
Add this:
pawn Код:
break;
Remove everything listed here:
pawn Код:
#if ENTER_TYPE == 1
#endif



Re: Unknown command. - thefatshizms - 19.11.2012

Still unknown command :/


Re: Unknown command. - Louris - 19.11.2012

Код:
CMD:createbiz(playerid, params[])
{
    new Float:pos[3], level, price, inter, payment;
    if(sscanf(params,"iiii", level, price, inter, payment)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "[USAGE]"EMBED_GREEN" /createbiz <level> <price> <interior> <payment>");
    if(inter < 0 || inter > 18) return SendClientMessage(playerid, COLOR_RED, "[ERROR]"EMBED_GREEN" You have entered an invalid interior id. Interiors range from 0-18");
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    for(new id = 0; id < sizeof(HouseI);id++) {
        HouseI[id][X_enter] = pos[0];
        HouseI[id][Y_enter] = pos[1];
        HouseI[id][Z_enter] = pos[2];
        HouseI[id][interior] = inter;
        HouseI[id][Level] = level;
        HouseI[id][Price] = price;
        HouseI[id][Payment] = payment;
        HouseI[id][Owned] = false;
        #if ENTER_TYPE == 1
        HouseI[id][pickup] = CreateDynamicPickup(1274, 1, HouseI[id][X_enter], HouseI[id][Y_enter], HouseI[id][Z_enter], -1, -1, -1, 100.0);
        #endif
    }
    return 1;
}
Try this.