arch0797
Новичок
Будьте так любезны помочь.
PHP:
if(strcmp(cmd, "/addhouse", true) == 0 && PlayerInfo[playerid][pAdminLevel] >= 4)//Сдесь меняем на свой уровень
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
for(new i; i < sizeof(AddHouseName);i++) //SendClientMessage(playerid, COLOR_WHITE,"Стиль %s номер %d",AddHouseName[i],i);
return SendClientMessage(playerid,COLOR_GREY,"•Используй: addhouse [цена] [Стиль от 0 до 3] [уровень]");
}
new price = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_GREY,"•Используй: /addhouse [цена] [Стиль от 0 до 3] [уровень]");
new style = strval(tmp);
if(style >= sizeof(AddHouseName)) return SendClientMessage(playerid,COLOR_GREY," несуществующей стиль");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_GREY,"•Используй: /addhouse [цена] [Стиль от 0 до 3] [уровень]");
new level = strval(tmp);
new Float:x1,Float:y1,Float:z1;
GetPlayerPos(playerid,x1,y1,z1);
HouseInfo[AllHouse][hExitx] = AddHouseCoord[style][0];
HouseInfo[AllHouse][hExity] = AddHouseCoord[style][1];
HouseInfo[AllHouse][hExitz] = AddHouseCoord[style][2];
HouseInfo[AllHouse][hInt] = AddHouseInt[style];
HouseInfo[AllHouse][hEntrancex] = x1;
HouseInfo[AllHouse][hEntrancey] = y1;
HouseInfo[AllHouse][hEntrancez] = z1;
strmid(HouseInfo[AllHouse][hOwner], "The State", 0, strlen("The State"), 255);
HouseInfo[AllHouse][hValue] = price;
HouseInfo[AllHouse][hHel] = 0;
HouseInfo[AllHouse][hArm] = 0;
HouseInfo[AllHouse][hLock] = 1;
HouseInfo[AllHouse][hOwned] = 0;
HouseInfo[AllHouse][hRooms] = 0;
HouseInfo[AllHouse][hRent] = 777;
HouseInfo[AllHouse][hRentabil] = 1;
HouseInfo[AllHouse][hLevel] = level;
HouseInfo[AllHouse][hVirtual] = AllHouse+1;
pickups++;
new strin[256];
format(strin,sizeof(strin),"[Дом продаётся] \n [Стоимость: $%d] \n [Описание: %s] \n [Уровень: %d]\n", HouseInfo[AllHouse][hValue],HouseInfo[AllHouse][hDiscription], HouseInfo[AllHouse][hLevel]);//Тут тоже меняем на свое
Create3DTextLabel(strin ,0x00FFFFAA,HouseInfo[AllHouse][hEntrancex], HouseInfo[AllHouse][hEntrancey], HouseInfo[AllHouse][hEntrancez],25, 0, 1);
printf("Дом номер %d создан",AllHouse);
AllHouse++;
return true;
}
return true;
}
