-
Posts
98 -
Joined
-
Last visited
-
Days Won
1
Everything posted by draobrehtom
-
Every time if you get error in scripting, you need to tell us, which error are you have or in which statements you are getting this error. Because I even don't know have you a logic error or something else.
-
I'm sorry for this, I was wrong: ` Try this, It was edited: addEventHandler( "onPlayerLogin", root, function( ) local account = getPlayerAccount( source ) if ( account ) then if ( not isGuestAccount( account ) ) then if ( not getAccountData( account, "FirstTime" ) ) then outputChatBox("You're playing for the first time!", source, 0, 255, 0) startResource ( skinnew ) setElementPosition ( source, 1254.50049, -790.40015, 92.03018 ) setAccountData(account, "FirstTime", true) else outputChatBox("This is not the first time for you!", source, 255, 0, 0) end end end end )
-
It is because you have already account data on the guest account in database mta.
-
Firstly, get the resource from name by getResourceFromName ( resourceName )
-
Test this example with added aclrequest to meta.xml and give us results, please: function startTheResource ( thePlayer, command, resourceName ) if ( resourceName ) then -- Check if they specified a resource name local resource = getResourceFromName ( resourceName ) -- Get the resource local start = startResource ( resource ) -- Start the resource if ( start ) then -- If it was successfully started... outputChatBox ( resourceName .. " was started successfully.", thePlayer, 255, 0, 0 ) else -- If it wasn't successfully started... outputChatBox ( "This resource doesn't exist.", thePlayer, 255, 0, 0 ) end else -- If they didn't put a resource name... outputChatBox ( "Please specify a resource to start.", thePlayer, 255, 0, 0 ) end end addCommandHandler ( "resource-start", startTheResource ) -- Make it trigger when somebody types "/resource-start"
-
It's for a security reason and more easily structure of acl (grouping rights and types of the rights, you need to read about it on the Wiki - acl.xml article).
-
But you need to log in with Console permission too, I think.
-
For a starting resource from another resource, you need to set a permission for you resource "startResource" "true" in acl.xml.
-
How to compute Velocity vector of Vehicle turret relative to Global World? I did some calculations and this is what I have been able to reach: local lrotX, lrotY = getVehicleTurretPosition(occupiedVehicle) -- Compute local 3D vector from bearing and elevation math local tVx,tVy,tVz = math.cos(lrotX) * math.cos(lrotY), math.sin(lrotX) * math.cos(lrotY), math.sin(lrotY) Maybe I need to calculate the difference of rotation angles turret and my vehicle, and then to compute Vector by formula above?
- 18 replies
-
Как мне получить вектор направления башни (S.W.A.T. автомобиль) относительно глобальной системы координат, для установки вектора velocity в createProjectile? Единственное, что на данный момент мне удалось сделать, это высчитать вектор башни, относительно самого транспорта. Я это вижу, как вычисление разницы вектора velocity автомобиля и вектора башни, однако не совсем уверен, что это так и как правильно это просчитать (проводил некоторые тесты с getElementVelocity автомобиля). local lrotX, lrotY = getVehicleTurretPosition(occupiedVehicle) -- Compute 3D vector from bearing and elevation math local tVx,tVy,tVz = math.cos(lrotX) * math.cos(lrotY), math.sin(lrotX) * math.cos(lrotY), math.sin(lrotY)
-
I don't know another way to do this, but you maybe can create ped localy and synchronize it with a world I think (or it will be gonna automatically).
-
[HELP]3D Perspective dxDraw when cursor moves in screen
draobrehtom replied to DaweeVokCs's topic in Scripting
I don't think so. I know a guy who did that, and he exactly did this without CEF. -
https://community.multitheftauto.com/index.php?p=resources&s=details&id=12905
-
Hi there. I interesting the one of important question. When I want to get getPedVehicleOccupied, what' will be more better with a performance side? To check every frame with onClientRender event if player are in a vehicle (getPedVehicleOccupied)? Or set events like a onClientVehicleEnter/Exit, onClientResourceStart etc. and check getPedVehicleOccupied only in those events?
-
Тоже интересует этот вопрос, плюс ещё: Каким образом более правильно (со стороны производительности) можно отследить, находится ли игрок в автомобиле (например 402)? Есть два варианта: * Короткий и простой вариант. Через onClientRender постоянно проверять на 402 == getElementModel(getPedOccupiedVehicle(localPlayer)), но здесь каждый каждр будет вызываться функция проверки. Не скажется ли это на производительности? * Либо рассмтреть все случаи (раставить события при старте ресурса, при входе/выходе из автомобиля, смерти, варпе в авто и т.д.), когда игрок будет в автобиле присутствовать/отсутствовать и от этого отталкиваться?
-
You can create missile with https://wiki.multitheftauto.com/wiki/CreateProjectile Get the angles of turret - https://wiki.multitheftauto.com/wiki/GetVehicleTurretPosition
-
Попробуй установить includeWorldModelInformation на true.
-
After 6 years this bug is not fixed.
-
You have a wrong name variable (killer1222) in function fixVehicle and you didnt get vehicle player. Try: fixVehicle(getPedOccupiedVehicle(getElementData(source, 'killer1222')))
-
[REL] HTML Login Panel with background video and sound
draobrehtom replied to draobrehtom's topic in Resources
Fiction-^, thank you, really nice to hear that. I'll try to update script, thank you for you commit. -
[REL] HTML Login Panel with background video and sound
draobrehtom replied to draobrehtom's topic in Resources
Thank you, LeSilver. Of course. you can, for now - it's a public resource. -
My first release login panel form: * Based on HTML 5 * Background Music, Video (with scripting functions, controllers). Some examples to interact with Lua there in code or MTA wiki, as you wish. https://community.multitheftauto.com/in ... s&id=12905
-
Pojazd z +4 siedzeniami
draobrehtom replied to MrDadosz's topic in Pomoc ze skryptami i programowaniem w Lua
Wątpe że to można zrobić w latwy sposób. Ja bym to zrobił za pomocą animacji i attach. Lub sprobować skasować kolizje i widoczność u pojazda i zrobić attach na istniejący samochod. Może uda się, sprobój. -
Na ile pamiętam, to robi zasob standartowy MTA - freecam. Znajduje się w kategoji "[editor]" w folderze twojego serwera.
-
Może pomogą ci te strone: https://wiki.multitheftauto.com/wiki/En ... rldTexture https://wiki.multitheftauto.com/wiki/Sh ... t_resource https://wiki.multitheftauto.com/wiki/Shader_examples
