Some wierd stuff but CMD
#1

Hai, im trying to make an code into zcmd but when i do ill get this ingame even if i fill it corret out here is my code:
pawn Код:
CMD:addhouse(playerid, params, cmdtext[])//Admin CMD //bug
{
        new string[256];
    new cmd[256];
    new giveplayerid, idx;
    new tmp[256];


    cmd = strtok(cmdtext, idx);
new Float:x, Float:y, Float:z, Float:r, price, interior, id, msg[128];
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, r);
        tmp = strtok(cmdtext,idx);
        if(!strlen(tmp)){
        ERROR("Usage: /AddHouse [price] (interior=0)");
        return 1;
        }

        price = strval(tmp);
        tmp = strtok(cmdtext,idx);
        if(!strlen(tmp)){
        ERROR("Usage: /AddHouse [price] (interior=0)");
        return 1;
        }


        interior = strval(tmp);




        if ((id = CreateHouse(x, y, z, r, price, interior)) == INVALID_HOUSE_ID) ERROR("House could not be created! House limit "#MAX_HOUSES" may have been reached");
        format(MSG, "House %d has been created with price %s and interior %d", id, FormatMoney(Houses[id][house_price]), Houses[id][house_interior]);
        MESSAGE(msg);
        Streamer_Update(playerid);
        return 1;
}
CMD:telehouse(playerid, params, cmdtext[])//some kind of bug
{
        new string[256];
    new cmd[256];
    new giveplayerid, idx;
    new tmp[256];


    cmd = strtok(cmdtext, idx);
        new Float:x, Float:y, Float:z, id;
        tmp = strtok(cmdtext,idx);

        if(!strlen(tmp)) return ERROR("Usage: /Telehouse [houseid]");

        id = strval(tmp);

        if (!GetHousePos(id, x, y, z)) return ERROR("Invalid house id!");
        SetPlayerPos(playerid, x, y ,z);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, x, y, z);
        return 1;
}
when i type ex. telehouse 5 ill recive this
Usage: /Telehouse [houseid]
Reply


Messages In This Thread
Some wierd stuff but CMD [FIXED] - by CrazyChoco - 19.06.2012, 22:22
Re: Some wierd stuff but CMD - by jessejanssen - 19.06.2012, 22:27
Re: Some wierd stuff but CMD - by CrazyChoco - 19.06.2012, 22:32
Re: Some wierd stuff but CMD - by CrazyChoco - 19.06.2012, 22:34
Re: Some wierd stuff but CMD - by Ray0 - 20.06.2012, 00:16
Re: Some wierd stuff but CMD - by SnG.Scot_MisCuDI - 20.06.2012, 00:24
Re: Some wierd stuff but CMD - by Mimic - 20.06.2012, 01:05
Re: Some wierd stuff but CMD - by CrazyChoco - 20.06.2012, 05:03
Re: Some wierd stuff but CMD - by SnG.Scot_MisCuDI - 20.06.2012, 05:16
Re: Some wierd stuff but CMD - by CrazyChoco - 20.06.2012, 12:10

Forum Jump:


Users browsing this thread: 1 Guest(s)