21.09.2011, 14:59
Quote:
Ehab, I'm scripted a /createhouse, but it always moves house ID 0 instead making a new one >.>...
|
pawn Код:
dcmd_createhouse(playerid, params[])
{
new Float:X,Float:Y,Float:Z, price;
//new count;
//printf("%d",count++);
if (PlayerInfo[playerid][pAdmin] < 10) return SendClientMessage(playerid,COLOR_WHITE,"You're not authroized to use this command !");
if(sscanf(params, "d", price)) return SendClientMessage(playerid, COLOR_WHITE, "[{EE5555}USAGE{FFFFFF}]: /createhouse [price]");
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < HouseInfo[h][hLevel])
{
new string[128];
format(string,sizeof(string),"You need level %d for this house.",HouseInfo[h][hLevel]);
SendClientMessage(playerid,COLOR_LIGHTRED,string);
return 1;
}
GetPlayerPos(playerid, X,Y,Z);
HouseInfo[h][hOwned] = 1;
HouseInfo[h][hLock] = 1;
HouseInfo[h][hValue] = price;
HouseInfo[h][hEntrancex] = X;
HouseInfo[h][hEntrancey] = Y;
HouseInfo[h][hEntrancez] = Z;
Create3DTextLabel("{FFFFFF}[{88EE88}Property{FFFFFF}]",0x00AE00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,20.0,0,1);
HouseInfo[h][hPickupID] = CreateDynamicPickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
}
}
return 1;
}