-
Posts
160 -
Joined
-
Last visited
Everything posted by iAxel
-
Hello all! Is it possible to synchronize server-client or client-server? Server NPC = {} function NPC:Create(skin, x, y, z, rotation) local ped = createPed(skin, x, y, z, rotation) return ped end Client NPC = {} function NPC:Move(X, Y) local x, y = getElementPosition(self) setPedCameraRotation(self, math.deg(math.atan2(X - x, Y - y))) setPedControlState(self, 'forwards', true) end Please help me Thx
-
Большое спасибо! Буду шаманить с функциями..
-
Так тоже пробовал не помогло
-
Please help me community... I really need this system
-
ALw7sH I do hope for your help I really need this system
-
Event 'onClientElementStreamIn' is not work Message is not sent to Debug Maybe due to the fact that the player chooses clothes are not logged in?
-
In debug no errors or warnings Use a function but nothing happens triggerClientEvent(root, 'addClothes', source, source, 'tshirtblack', 'cj_ped_torso') Perhaps from for it? Server Clothes = { ['cj_ped_torso'] = { {'tshirtwhite'}, {'tshirtgrey'}, {'tshirtbeige'} }, ['cj_ped_legs'] = { {'legsblack'}, {'legsblue'}, {'legsbrown'} } } local s = Clothes['cj_ped_torso'][math.random(1, 3)] local t = Clothes['cj_ped_legs'][math.random(1, 3)] triggerClientEvent(root, 'addClothes', source, source, s[1], 'cj_ped_torso') triggerClientEvent(root, 'addClothes', source, source, t[1], 'cj_ped_legs') Client ---Shaders local Shader = {} Shader[1] = dxCreateShader('files/shaders/replace.fx', 0, 0, true, 'ped')---Shirt Shader[2] = dxCreateShader('files/shaders/replace.fx', 0, 0, true, 'ped')---Leg --Table Clothes = { ['cj_ped_torso'] = { ['tshirtwhite'] = { index = 1, model = nil }, ['tshirtgrey'] = { index = 1, model = nil }, ['tshirtbeige'] = { index = 1, model = nil } }, ['cj_ped_legs'] = { ['legsblack'] = { index = 2, model = nil }, ['legsdblue1'] = { index = 2, model = nil }, ['legsblue'] = { index = 2, model = nil } } } --Loop for model, clothe in pairs(cClothes['cj_ped_torso']) do clothe.model = dxCreateTexture('files/clothes/'..model..'.png') end for model, clothe in pairs(cClothes['cj_ped_legs']) do clothe.model = dxCreateTexture('files/clothes/'..model..'.png') end addEvent('addClothes', true) function addClothes(player, clothesTexture, clothesModel) local cType = cClothes[clothesModel] local clothe = cType[clothesTexture] local clothes = getElementData(player, 'clothes') if type(clothes) == 'table' and table.getn(clothes) > 0 then table.insert(clothes, {clothesModel, clothe}) setElementData(player, 'clothes', clothes) else local cTable = {} table.insert(cTable, {clothesModel, clothe}) setElementData(player, 'clothes', cTable) end --[[if (Shader[clothe.index]) then resetClothes(player, clothesModel, clothe.index) dxSetShaderValue(Shader[clothe.index], 'gTexture', clothe.model) engineApplyShaderToWorldTexture(Shader[clothe.index], clothesModel, player) end]] end addEventHandler('addClothes', root, addClothes) addEventHandler('onClientElementStreamIn', root, function () if getElementType(source) == 'player' then local clothes = getElementData(source, 'clothes') if type(clothes) == 'table' and table.getn(clothes) > 0 then for k, v in pairs(clothes) do dxSetShaderValue(Shader[v[2].index], 'gTexture', v[2].model) engineApplyShaderToWorldTexture(Shader[v[2].index], v[1], source) end end end end )
-
How about executing the addClothes function onClientResourceStart ? Or at least when the element is streamed in. Can be an example?
-
In this way? addEvent('addClothes', true) function addClothes(player, clothesTexture, clothesModel) local cType = cClothes[clothesModel] local clothe = cType[clothesTexture] if (player == localPlayer) then if (Shader) then dxSetShaderValue(Shader, 'gTexture', clothe.model) engineApplyShaderToWorldTexture(Shader, clothesModel, player) end end end addEventHandler('addClothes', root, addClothes)
-
Please help me community!
-
Don't work If use root then the localPlayer and another Player the same texture
-
Всем привет! Я хотел сделать систему одежд с помощи шейдеров. Т.е одев футболку addPedClothes(source, 'tshirtwhite', 'tshirt', 0) , я хотел чтобы менялась только текстура футболки. Клиент local Shader = dxCreateShader('files/shaders/replace.fx', 0, 0, true, 'ped') --- Создаем шейдер для игрока ---Таблица одежды local Clothes = { ['cj_ped_torso'] = { ['tshirtwhite'] = {---белая текстура model = nil }, ['tshirtred'] = {---красная текстура model = nil }, ['tshirtblack'] = {---черная текстура model = nil } } } ---Создаем текстуры for model, clothe in pairs(cClothes['cj_ped_torso']) do clothe.model = dxCreateTexture('files/clothes/'..model..'.png') end ---Применяем текстуры на одежду addEvent('addClothes', true) function addClothes(player, clothesTexture, clothesModel) local cType = cClothes[clothesModel] local clothe = cType[clothesTexture] if (Shader) then dxSetShaderValue(Shader, 'gTexture', clothe.model) engineApplyShaderToWorldTexture(Shader, clothesModel, player) end end addEventHandler('addClothes', root, addClothes) Сервер triggerClientEvent(source, 'addClothes', source, source, 'tshirtblack', 'cj_ped_torso') Шейдер texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } Функция работает, но дело в том что текстура видна только локальному игроку, другим игрокам как стандартная одежда. Можно ли сделать чтобы было видно всем?
-
Hello everyone! I wanted to make a system of clothing with shaders. code: CLIENT local Shader = dxCreateShader('files/shaders/replace.fx', 0, 0, true, 'ped') --- Create shader for player ---Clothes Table local Clothes = { ['cj_ped_torso'] = { ['tshirtwhite'] = { model = nil }, ['tshirtred'] = { model = nil }, ['tshirtblack'] = { model = nil } } } ---Create texture for player for model, clothe in pairs(cClothes['cj_ped_torso']) do clothe.model = dxCreateTexture('files/clothes/'..model..'.png') end ---Appy Texture for player addEvent('addClothes', true) function addClothes(player, clothesTexture, clothesModel) local cType = cClothes[clothesModel] local clothe = cType[clothesTexture] if (Shader) then dxSetShaderValue(Shader, 'gTexture', clothe.model) engineApplyShaderToWorldTexture(Shader, clothesModel, player) end end addEventHandler('addClothes', root, addClothes) SERVER triggerClientEvent(source, 'addClothes', source, source, 'tshirtblack', 'cj_ped_torso') replace.fx texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } The function works fine but the texture is visible only localPlayer other players see the standard clothing Are there any ideas that it was visible all players?
-
https://wiki.multitheftauto.com/wiki/OnClientWeaponFire
-
It`s fantastic level design! The editor will be available to other users? i.e, whether the release? I very much hope that will release you have all helped)))
-
It`s really amazing Terrain Editor. If not a secret that is used as a terrain? I think that this is likely shader. I've seen your work, you're pretty amazing man with lots of ideas and creativity! I hope that will release Terrain Editor, but I think that you're a man of principle.
-
Hello all! Decided to use the library sbx320 Create a test project and ran it like all it works fine but in the console shows the info about the classes. This is normal or not? And yet, how to use it? Whether there is Tutorials on use the library? Thanks
-
Жаль вас, человек без фантазии как без души
-
Товарищ обижаете) я не из того поколения чтобы использовать mysql_%) В данный момент использую mysqli, но т.к оно тоже deprecated, буду использовать через ORM, DAO. Жду новой версии yii framework, по мне самый удобный вариант для использования и для защиты. А пока буду использовать свои классы... Конечно если вы не дружите с photoshop`ом то и сверстать что либо сложно... Кстати из классов P.s Обновил скриншоты
-
А все началось наверное из за того что владелец мта-ресурс хотел немного подзаработать и открыл такой сайт, такое было и с павно-инфо и тому подобных, видел только павно су и про-павн отличались но нет так уж и ярко... Насчет мта-ресурс мне не вериться что он написал свой движок, хотел сперва внедрить bootstrap (наверное хотел резиновым сделать), после сам попытался и это вышло криво (До сих пор не исправил) Одним словом кривой CMS. Оффтоп: Зацените мой сайт Переделываю свой ucp под MTA, год назад продавал, можно найти тему на павно-инфо. (Шаблон еще не доделан до конца)
-
В некоторых случаях стоит ткнуть в вики, пусть сами тоже чему нибудь научаться, а если и в прям готовое брать, то с MTA случиться тоже самое что и с SA-MP... У меня тут много тем о просьбах помочь мне с кодом но не сделать вместо меня. Странное у тебя точка зрения, я начал играть с 0.3a версии, после только к 0.3e заинтересовался с программированием, и начал изучать активно, я в то время и не мог подумать что есть и другой мультиплеер к игре и до сих пор жалею что мне попался SA-MP а не MTA, но сейчас в SA-MP много тех кто деньги зарабатывает легким путем включая самого разработчика... Я как и ты тоже хочу чтобы такое не было в MTA...
