pawn Код:
CMD:createhouse(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 6)
{
new Float:xa, Float:ya, Float:za;
new Float:hax, Float:hay, Float:haz;
new hhprice;
new hhinterior;
GetPlayerPos(playerid, xa, ya, za);
if(!sscanf(params, "fffii", hax, hay, haz, hhprice, hhinterior))
{
new hid = Index[tophnumber] + 1;
{
format(file5, sizeof(file5),"realityrp/houses/%s.ini", hid);
dini_Create(file5);
dini_IntSet(file5, "hforsale",House[hid][hforsale] = 1);
dini_IntSet(file5, "hprice",House[hid][hprice] = hhprice);
dini_IntSet(file5, "howner",House[hid][howner] = -1);
dini_IntSet(file5, "henx",House[hid][henx] = xa);
dini_IntSet(file5, "heny",House[hid][heny] = ya);
dini_IntSet(file5, "henz",House[hid][henz] = za);
dini_IntSet(file5, "hexx",House[hid][hexx] = hax);
dini_IntSet(file5, "hexy",House[hid][hexy] = hay);
dini_IntSet(file5, "hexz",House[hid][hexz] = haz);
dini_IntSet(file5, "hint",House[hid][hint] = hhinterior);
dini_IntSet(file5, "hvw",House[hid][hvw] = hid);
dini_IntSet(file5, "hlocked",House[hid][hlocked] = 1);
CreatePickup(1273, 1, henx, heny, henz, 0);
Index[tophnumber] = Index[tophnumber] + 1;
}
}
else return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /createhouse [Xcord][Ycord][Zcord][Price][Interior ID]");
}
else return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to do this!");
}