21.09.2011, 18:03
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;
}