27.01.2014, 21:27
(
Последний раз редактировалось TheSnaKe; 27.01.2014 в 22:23.
)
Hey guys, i have rp server, house system it's work perfectly, but i want to add a level on it, like if someone is Level 1 and the house is for Level 2, he wouldn't be able to buy it, i tried to do it, but every time is not working or i get errors/warnings, so here is the /createhouse code.
PHP код:
}
CMD:createhouse(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use command.");
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
for(new idx=1; idx<MAX_HOUSES; idx++)
{
if(!HouseInfo[idx][hLevel])
{
// Getting Business Setup
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
// Making Business
HouseInfo[idx][hLevel] = 1;
HouseInfo[idx][hPrice] = 50000;
HouseInfo[idx][hStatus] = 0;
format(HouseInfo[idx][hOwner], 32, "The State");
HouseInfo[idx][hX] = X;
HouseInfo[idx][hY] = Y;
HouseInfo[idx][hZ] = Z;
HouseInfo[idx][hMoney] = 0;
HouseInfo[idx][hMaterials] = 0;
HouseInfo[idx][hWeed] = 0;
HouseInfo[idx][hcocaine] = 0;
HouseInfo[idx][hGun][0] = 0;
HouseInfo[idx][hGunAmmo][0] = 0;
HouseInfo[idx][hGun][1] = 0;
HouseInfo[idx][hGunAmmo][1] = 0;
HouseInfo[idx][hGun][2] = 0;
HouseInfo[idx][hGunAmmo][2] = 0;
HouseInfo[idx][hGun][3] = 0;
HouseInfo[idx][hGunAmmo][3] = 0;
HouseInfo[idx][hGun][4] = 0;
HouseInfo[idx][hGunAmmo][4] = 0;
HouseInfo[idx][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ], 0);
format(string, sizeof(string), "Owner: %s\nHouse Type: %s\nFor Sale\nPrice: $%d", HouseInfo[idx][hOwner], HT(idx), HouseInfo[idx][hPrice]);
HouseInfo[idx][hText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ]+0.3, 15);
format(string, sizeof(string), "AdmWarn: %s has created house ID %d.", RPN(playerid), idx);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/house.log", string);
idx = MAX_HOUSES;
}
}
return 1;
}