Перейти к содержимому

Уважаемый гость, если у Вас возникли проблемы с регистрацией, просьба обратиться в тех.поддержку или на почту admin@pawno-crmp.ru

Для полного доступа ко всем функциям форума, Вам необходимо зарегистрироваться и авторизоваться.

Фотография

Деревья в воздухе, нужна помощь

- - - - -

Лучший Ответ Администратор , 11 Ноябрь 2017 - 16:47

Регулируйте высоту по Z

static const stock Float:Derevo[][3] = {
    {-2498.8706,2245.7942,56.0429},
    {-2499.4719,2238.5771,55.9502},
    {-2496.2920,2240.3848,56.0129},
    {-2492.3843,2226.1772,55.8191},
    {-2488.5527,2229.3103,55.8723},
    {-2483.0586,2231.6086,56.0290},
    {-2478.5649,2229.7749,56.0520},
    {-2477.3999,2235.5281,56.2257},
    {-2482.3186,2239.4282,56.2255},
    {-2478.0588,2242.6990,56.3890},
    {-2476.6028,2246.6882,56.4968},
    {-2472.4651,2258.1990,56.7560},
    {-2478.6440,2257.4773,56.6379},
    {-2481.5474,2263.1602,56.6436},
    {-2489.3501,2258.4673,56.3864},
    {-2493.5020,2262.5476,56.3591},
    {-2471.9421,2244.1414,56.5180},
    {-2468.6885,2235.8120,56.3719},
    {-2470.6931,2227.6780,56.1119}
};

эти красные корды, где прибавить, где убавить.

Перейти к сообщению »


  • Закрытая тема Тема закрыта
В теме одно сообщение

#1
offline   goshan

goshan
  • 1
    • Сообщений: 2
    • Регистрация: 11.05.15

Проблема заключается в летающих деревья на работе лесоруб. Все работает, но сами деревья в воздухе, не знаю как их занизить до земли. Ниже будет код данной работы(там используются эти деревья).

Вот фото проблемы:

Скриншоты проблемы
https://imgur.com/a/5KLtM

Сам код
 
new DerevoTimer[MAX_PLAYERS];
new TimeDerevo[38];
new gDerevo[38], TOTALDEREVO;
static const stock Float:Derevo[][3] = {
	{-2498.8706,2245.7942,56.0429},
	{-2499.4719,2238.5771,55.9502},
	{-2496.2920,2240.3848,56.0129},
	{-2492.3843,2226.1772,55.8191},
	{-2488.5527,2229.3103,55.8723},
	{-2483.0586,2231.6086,56.0290},
	{-2478.5649,2229.7749,56.0520},
	{-2477.3999,2235.5281,56.2257},
	{-2482.3186,2239.4282,56.2255},
	{-2478.0588,2242.6990,56.3890},
	{-2476.6028,2246.6882,56.4968},
	{-2472.4651,2258.1990,56.7560},
	{-2478.6440,2257.4773,56.6379},
	{-2481.5474,2263.1602,56.6436},
	{-2489.3501,2258.4673,56.3864},
	{-2493.5020,2262.5476,56.3591},
	{-2471.9421,2244.1414,56.5180},
	{-2468.6885,2235.8120,56.3719},
	{-2470.6931,2227.6780,56.1119}
};
forward GatDerevo(playerid);
public GatDerevo(playerid)
{
    TogglePlayerControllable(playerid, 1);
    KillTimer(DerevoTimer[playerid]);
	DestroyObject(gDerevo[GetPVarInt(playerid, "Derevo")]);
	DisablePlayerCheckpoint(playerid);
	ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,0,1,1,1,1);
	if(IsPlayerAttachedObjectSlotUsed(playerid, 3)) RemovePlayerAttachedObject(playerid, 3);
	SetPlayerAttachedObject(playerid, 4, 1463, 1, 0.184699, 0.426247, 0.000000, 259.531341, 80.949592, 0.000000, 0.476124, 0.468181, 0.470769);
	SetPlayerCheckpoint(playerid,-2514.8853,2258.2144,56.8203,3.0);
	TimeDerevo[GetPVarInt(playerid, "Derevo")] = 12;
	SetPVarInt(playerid, "LessStatus", 1);
    return 0;
}
if(UseWork[playerid] == 2)
{
        DeletePVar(playerid, "OldLessSkin");
        UseWork[playerid] = 0;
        DeletePVar(playerid, "LessProgress");
	DeletePVar(playerid, "Derevo");
	DeletePVar(playerid, "LessStatus");
	if(IsPlayerAttachedObjectSlotUsed(playerid, 3)) RemovePlayerAttachedObject(playerid, 3);
	if(IsPlayerAttachedObjectSlotUsed(playerid, 4)) RemovePlayerAttachedObject(playerid, 4);
}
	if(UseWork[playerid] == 2 && IsPlayerInRangeOfPoint(playerid, 3.0, -2514.8853,2258.2144,56.8203))
	{
	    new string[6],str[18];
	    DisablePlayerCheckpoint(playerid);
	    RemovePlayerAttachedObject(playerid, 4);
		new rand = 30 + random(60);
	    PI[playerid][pWorkSalary] += rand;
	    Lessdrov += rand;
	    format(str,18,"ПРИНЕСЕНО: %d KG",PI[playerid][pWorkSalary]);
		PlayerTextDrawSetString(playerid,StatusWork[playerid][4],str);
	    format(string,6,"%d кг",rand);
	    SetPlayerChatBubble(playerid,string,COLOR_PURPLE,20.0,10000);
	    ClearAnimations(playerid);
		ApplyAnimation(playerid,"PED","IDLE_tired",4.1,0,1,1,0,1);
	    DeletePVar(playerid, "Derevo");
	    SetPVarInt(playerid, "LessProgress", 0);
	    SetPVarInt(playerid, "LessStatus", 0);
	    PlayerTextDrawSetString(playerid, StatusWork[playerid][5], "ПРОЦЕНТОВ: 0%");
	SetPVarInt(playerid, "Derevo", TOTALDEREVO);
	TOTALDEREVO++;
	SetPlayerAttachedObject(playerid, 3, 341, 6, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
	SetPlayerCheckpoint(playerid,Derevo[GetPVarInt(playerid, "Derevo")][0],Derevo[GetPVarInt(playerid, "Derevo")][1],Derevo[GetPVarInt(playerid, "Derevo")][2], 3.0);
	return 1;
	}
	if(UseWork[playerid] == 2 && PRESSED(KEY_FIRE))
	{
	    if(GetPVarInt(playerid,"LessProgress") >= 100) return 1;
	    if(IsPlayerInRangeOfPoint(playerid,2.5,Derevo[GetPVarInt(playerid, "Derevo")][0],Derevo[GetPVarInt(playerid, "Derevo")][1],Derevo[GetPVarInt(playerid, "Derevo")][2]))
	{
        ApplyAnimation(playerid, "CHAINSAW", "weapon_csaw", 4.0, 0, 0, 0, 0, 0);
        new animlib[30], animname[30];
	if(GetString(animlib[playerid], "CHAINSAW") && GetString(animname[playerid], "weapon_csaw"))
		{
			SetPVarInt(playerid, "LessProgress", GetPVarInt(playerid, "LessProgress") + 5);
			new str[14];
			format(str,14,"ПРОЦЕНТОВ: %d%",GetPVarInt(playerid,"LessProgress"));
			PlayerTextDrawSetString(playerid,StatusWork[playerid][5],str);
			return 1;
		}
	}
}
if(PRESSED(KEY_FIRE) || PRESSED(KEY_HANDBRAKE) || PRESSED(KEY_CROUCH) || PRESSED(KEY_ACTION))
 {
 if(UseWork[playerid] == 2 && GetPVarInt(playerid,"LessStatus") > 0 && IsPlayerAttachedObjectSlotUsed(playerid, 4))
 {
	SendClientMessage(playerid, COLOR_RED, "Вы уронили срубленые бруски!");
        DisablePlayerCheckpoint(playerid);
	RemovePlayerAttachedObject(playerid, 4);
	ClearAnimations(playerid);
	ApplyAnimation(playerid,"PED","IDLE_tired",4.1,0,1,1,0,1);
	DeletePVar(playerid, "Derevo");
	SetPVarInt(playerid, "LessProgress", 0);
	SetPVarInt(playerid, "LessStatus", 0);
        PlayerTextDrawSetString(playerid, StatusWork[playerid][5], "ПРОЦЕНТОВ: 0%");
	SetPVarInt(playerid, "Derevo", TOTALDEREVO);
	TOTALDEREVO++;
	SetPlayerAttachedObject(playerid, 3, 341, 6, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
	SetPlayerCheckpoint(playerid,Derevo[GetPVarInt(playerid, "Derevo")][0],Derevo[GetPVarInt(playerid, "Derevo")][1],Derevo[GetPVarInt(playerid, "Derevo")][2], 3.0);
}
case 669:
{
	if(!response) return 1;
    	SetPVarInt(playerid, "OldLessSkin",GetPlayerSkin(playerid));
	SetPlayerSkin(playerid, 260);
	UseWork[playerid] = 2;
	for(new i; i < 6; i++) PlayerTextDrawShow(playerid, StatusWork[playerid][i]);
	PlayerTextDrawSetString(playerid, StatusWork[playerid][4], "ПРИНЕСЕНО: 0 KG");
	PlayerTextDrawSetString(playerid, StatusWork[playerid][5], "ПРОЦЕНТОВ: 0%");
	SetPVarInt(playerid, "Derevo", TOTALDEREVO);
	TOTALDEREVO++;
	SetPlayerCheckpoint(playerid, Derevo[GetPVarInt(playerid, "Derevo")][0], Derevo[GetPVarInt(playerid, "Derevo")][1], Derevo[GetPVarInt(playerid, "Derevo")][2], 3.0);
	SetPlayerAttachedObject(playerid, 3, 341, 6, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
	SendClientMessage(playerid, COLOR_BLUE, "Вы начали работу на лесопилке, спилите дерево.");
	return 1;
}
case 670:
{
	if(!response) return 1;
	new money = PI[playerid][pWorkSalary]*AMOUNT_OF_SALARY_SAWMILL;
        SetPlayerSkin(playerid, GetPVarInt(playerid, "OldLessSkin"));
        SendMes(playerid, COLOR_BLUE, "Вы закончили рабочий день, Ваш заработок: %i руб",money);
        PI[playerid][pWorkSalary] = 0;
        new str[32];
	format(str, sizeof(str), "~g~+%d руб", money);
	GameTextForPlayer(playerid,str,3000,1);
	if(IsPlayerAttachedObjectSlotUsed(playerid, 3)) RemovePlayerAttachedObject(playerid, 3);
	if(IsPlayerAttachedObjectSlotUsed(playerid, 4)) RemovePlayerAttachedObject(playerid, 4);
	DeletePVar(playerid, "OldLessSkin");
	UseWork[playerid] = 0;
	DeletePVar(playerid, "Derevo");
	for(new i; i < 6; i++) PlayerTextDrawHide(playerid, StatusWork[playerid][i]);
	DisablePlayerCheckpoint(playerid);
	TransferMoney(-1,playerid,money);
	return 1;
}
if(GetPVarInt(i,"LessProgress") >= 100 && !GetPVarInt(i,"LessStatus"))
{
	MoveObject(gDerevo[GetPVarInt(i, "Derevo")], Derevo[GetPVarInt(i, "Derevo")][0], Derevo[GetPVarInt(i, "Derevo")][1], Derevo[GetPVarInt(i, "Derevo")][2]+0.004, 0.004, 0.00000000, 90.00000000, 0.00000000);
	PlayerTextDrawSetString(i, StatusWork[i][5], "ПРОЦЕНТОВ: 0%");
	TogglePlayerControllable(i, 0);
        DerevoTimer[i] = SetTimerEx("GatDerevo", 2000, false, "i", i);
}



  • 0

#2
offline   Администратор

Администратор
  • 27
    • Сообщений: 151
    • Регистрация: 17.08.17
✓  Лучший Ответ

Регулируйте высоту по Z

static const stock Float:Derevo[][3] = {
    {-2498.8706,2245.7942,56.0429},
    {-2499.4719,2238.5771,55.9502},
    {-2496.2920,2240.3848,56.0129},
    {-2492.3843,2226.1772,55.8191},
    {-2488.5527,2229.3103,55.8723},
    {-2483.0586,2231.6086,56.0290},
    {-2478.5649,2229.7749,56.0520},
    {-2477.3999,2235.5281,56.2257},
    {-2482.3186,2239.4282,56.2255},
    {-2478.0588,2242.6990,56.3890},
    {-2476.6028,2246.6882,56.4968},
    {-2472.4651,2258.1990,56.7560},
    {-2478.6440,2257.4773,56.6379},
    {-2481.5474,2263.1602,56.6436},
    {-2489.3501,2258.4673,56.3864},
    {-2493.5020,2262.5476,56.3591},
    {-2471.9421,2244.1414,56.5180},
    {-2468.6885,2235.8120,56.3719},
    {-2470.6931,2227.6780,56.1119}
};

эти красные корды, где прибавить, где убавить.


  • 1


Количество пользователей, читающих эту тему: 0

0 пользователей, 0 гостей, 0 анонимных


Данную тему посетили 9 пользователей