Will this command work ?
#1

pawn Код:
dcmd_createhouse(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        new price, level, descri;
        new houseid = -1;
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X,Y,Z);
        if (sscanf(params, "ddS(No Description)[64]",price, level, descri))
            return SendClientMessage(playerid, COLOR_WHITE, "[{EE5555}USAGE{FFFFFF}]: /createhouse [price] [level] [description ( optinal )");
        if (PlayerInfo[playerid][pAdmin] >= 10)
        {
            for(new h = 0; h < sizeof(HouseInfo); h++)
            {
                if(HouseInfo[h][hExists] == 1)
                {
                    houseid = h + 1;
                }
                HouseInfo[houseid][hOwned] = 1;
                HouseInfo[houseid][hLock] = 1;
                HouseInfo[houseid][hValue] = price;
                HouseInfo[houseid][hLevel] = level;
                HouseInfo[houseid][hDiscription] = descri;
                HouseInfo[houseid][hEntrancex] = X;
                HouseInfo[houseid][hEntrancey] = Y;
                HouseInfo[houseid][hEntrancez] = Z;
                Create3DTextLabel("{FFFFFF}[{88EE88}Property{FFFFFF}]",0x00AE00FF,HouseInfo[h][hEntrancex], HouseInfo[houseid][hEntrancey], HouseInfo[houseid][hEntrancez]+0.75,20.0,0,1);
                HouseInfo[houseid][hPickupID] = CreateDynamicPickup(1273, 1, HouseInfo[houseid][hEntrancex], HouseInfo[houseid][hEntrancey], HouseInfo[houseid][hEntrancez]);
            }
        }
    }
    OnPropUpdate();
    return 1;
}
If no, what's wrong ?
Reply
#2

pawn Код:
new price, level, descri;
Should be
pawn Код:
new price, level, descri[64];
And just test yourself!
Reply
#3

Run a self hosted server for testings.
Reply
#4

When I do /createhouse 10 10 for example, moves all of the houses (200 in this case) and makes their names like ' 34134 ' 265' '245 '54' '5' 135' '13' same with levels.
pawn Код:
dcmd_createhouse(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        new price, level;
        new houseid = -1;
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X,Y,Z);
        if (sscanf(params, "dd",price, level))
            return SendClientMessage(playerid, COLOR_WHITE, "[{EE5555}USAGE{FFFFFF}]: /createhouse [price] [level]");
        if (PlayerInfo[playerid][pAdmin] >= 10)
        {
            for(new h = 0; h < sizeof(HouseInfo); h++)
            {
                if(HouseInfo[h][hExists] == 0)
                {
                    houseid = h + 1;
                }
                HouseInfo[houseid][hOwned] = 1;
                HouseInfo[houseid][hLock] = 1;
                HouseInfo[houseid][hValue] = price;
                HouseInfo[houseid][hLevel] = level;
                HouseInfo[houseid][hEntrancex] = X;
                HouseInfo[houseid][hEntrancey] = Y;
                HouseInfo[houseid][hEntrancez] = Z;
                Create3DTextLabel("{FFFFFF}[{88EE88}Property{FFFFFF}]",0x00AE00FF,HouseInfo[h][hEntrancex], HouseInfo[houseid][hEntrancey], HouseInfo[houseid][hEntrancez]+0.75,20.0,0,1);
                HouseInfo[houseid][hPickupID] = CreateDynamicPickup(1273, 1, HouseInfo[houseid][hEntrancex], HouseInfo[houseid][hEntrancey], HouseInfo[houseid][hEntrancez]);
            }
        }
    }
    OnPropUpdate();
    return 1;
}
Reply
#5

Checked, works, fixed, thanks anyway.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)