-
Posts
965 -
Joined
-
Last visited
Everything posted by DakiLLa
-
Color code format is hex AARRGGBB (alpha, red, green, blue): local gui_image = guiCreateStaticImage( ... ) local hex = "FFFF0000" -- (255, 255, 0, 0) red color guiSetProperty( gui_image, "ImageColours", "tl:"..hex.." tr:"..hex.." bl:"..hex.." br:"..hex ) tl - top left tr - top right bl - bottom left br - bottom right You can apply different color codes to tl,tr,bl,br, so you can even create some sort of gradients.
-
If I understood correctly you want to freeze your ped when the animation is playing, right? If so, set the "updatePosition" argument to false: --[[ loop: true updatePosition: false interruptable: false freezeLastFrame: false ]] setPedAnimation( source, "SMOKING", "M_smkstnd_loop", -1, true, false, false, false )
-
Buga_Boss, где-то тут на форуме читал, что в ресурсе GTW-RPG эту шляпу кое-как пофиксили, по крайней мере прицепы не отцепляются тут и там (вроде). Попробуй порыться в тамошних скриптах, может быть найдешь что полезное, к примеру в GTWvehicles как раз упоминается синхронизация прицепов в логе изменений.
-
I'd use OOP for that as it has some neat stuff: local myObject = Object.create( ... ) local myOtherObject = Object.create( ... ) local otherObjectOffset = Vector3( 0, 3, 0 ) -- moving 'myOtherObject' on 3 units ahead of 'myObject' over Y axis local otherObjectPosition = myObject.matrix:transformPosition( otherObjectOffset ) myOtherObject:setPosition( otherObjectPosition ) Don't forget to enable OOP in meta.xml.
-
Hi. I'll try to answer some of your questions. If you are going to use default (native, non-custom) objects, then In-built map editor is your option. Run it on your server, let your friends join and map your stuff together. No, it won't be laggy (unless your crappy PC that can't run 10 year old game properly) and it will render correctly, but there is one thing: only 300 objects (or so) can be rendered at one time; means that if there are more than 300 objects in the point you are standing on, then some of the objects will start to dissapear from your screen (thats how the streamer works) while others will appear and so on. You can be sure that you won't fall through the map while driving fast, MTA streamer perfectly handles such situations. Well ofcourse you can put custom models on your server but don't expect it to work fine with lots and lots of custom objects. I experienced some difficulties when I was trying to move custom city to MTA (it was Myriad Islands mod afair) and I reached the point where some of the models started to loose their collisions, not sure may be I did something wrong, just keep in your mind that it's really unstable thing. There is a limit for all elements on the server (including objects, vehicles, players, peds etc.) which is 65535 or so and I doubt you will ever reach this limit, so just forget about it and put as many objects/stuff on your server as you need. Hope it helps you a bit. Cheers.
-
Change it back to onClientResourceStart, since onClientPlayerJoin event will not trigger for the player who just joined the server because the script hasn't been downloaded yet to the client cache. Hmm, I'm out of ideas, may be use a timer: setTimer( function() fadeCamera (true) setCameraMatrix(-2241.9584960938,-1743.4710693359,481.54472045898, 2659.0986328125, 2728.521484375, 10.774273872375) end, 1000, 1)
-
The code is fine. The only thing that can cause problems is loginPanel() function (may be something is breaking there when you reconnect, did you check debug logs for errors?), though you could put fadeCamera() and setCameraMatrix() before the loginPanel() function and see if it fixes your problem. Also it is a good practice to put some debug lines of outputChatBox() after every function call inside your onClientResourceStart event to determine where it actually fails when you connect for the 2nd time. Like this: addEventHandler("onClientResourceStart", resourceRoot, function () loginPanel() outputChatBox( "okay, 1" ) setPlayerHudComponentVisible ("radar", false ) ped = createPed ( 73, -2239.3713378906,-1741.8660888672,480.82662963867, 485,true ) setPedAnimation( ped, "ped", "XPRESSscratch",nil,true,true,false,false) -- "ped", "XPRESSscratch" -- default "ped", endchat_01 guiSetInputMode("no_binds_when_editing") outputChatBox( "okay, 2" ) fadeCamera (true) setCameraMatrix(-2241.9584960938,-1743.4710693359,481.54472045898, 2659.0986328125, 2728.521484375, 10.774273872375) end )
-
Yea, try this one (you forgot to put an extra 'end'): addCommandHandler('anim', function(command, lib, name) if not getPedOccupiedVehicle(g_Me) then server.setPedAnimation(g_Me, lib, name, true, true) end end )
-
The second argument of addEventHandler() represents the element you are attaching the event to. Attaching "onMarkerHit" to root means that it will trigger everytime when you hit ANY existing marker on the server; to resourceRoot - will trigger if you hit markers created only by this resource (where this script is located). If you want it to trigger only for a specific marker, then you should pass its element as 2nd argument as well. You should have something like this (I guess): local myMarker = createMarker( ... ) ... function markerHitFunc() -- some code here end addEventHandler( "onMarkerHit", myMarker, markerHitFunc )
-
KariiiM, oh, alright, corrected my code
-
Can you explain, you don't want to set animation if player is in vehicle, right? If so, try this code (replace applyAnimation() function): function applyAnimation(leaf) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndAnim, 'animlist') if not leaf then return end end --if not isPedInVehicle(g_Me) then if not getPedOccupiedVehicle(g_Me) then server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true) end end
-
Попробуй отключить сортировку столбцов с помощью guiGridListSetSortingEnabled.
-
Probably because of occlusions (click) (kind of graphic optimisation) turned on by default. Create an empty resource with a single lua script file inside and put next code in it: -- Client side addEventHandler( "onClientResourceStart", resourceRoot, function() setOcclusionsEnabled( false ) end )
-
setElementDimension
-
getVehicleWheelStates
-
Multi Selection Tool (mst) Take a look at this one, may be that's what you are looking for.
-
Не уверен, но можно попробовать testLineAgainstWater.
-
k = tostring(k)
-
В консоли и не будет ничего, конечно. Используйте команду /debugscript 3 чтобы открыть окно вывода отладочных сообщений.
-
Так я и говорю, что никогда не видел столь огромных проектов) Разве что вот на ум приходят следующие поделки: 1) viewtopic.php?f=93&t=75215&p=735778&hilit=city#p735778 2) viewtopic.php?f=93&t=71782&hilit=city 3) увожу под спойлер, ибо там картинки с другого сайта; проект называется 1337land by Jackob (можно нагуглить дополнительной информации)
-
Я, если честно, никогда не видел проектов, где кто-то создал бы настолько огромную карту, что она бы вышла за пределы границ мира (-3000, 3000; с достаточной долей детализированности, естественно, а не просто расставленные дорожки и домики). Это ж сколько времени убить надо чтобы дойти вплотную к границам.. ) Считаю, что в пределах текущих границ места дофига. Ну, тоже вариант.
-
Ну так можно удалить все стандартные объекты и начать строить "огромный город" прямо из центра карты.
-
Oh, yea, sorry. I just found out that there is similar bug report on mantis: https://bugs.mtasa.com/view.php?id=8242 Well, idk, you could make a workaround with element datas, like.. Set player data that he has entered/left the specified vehicle. addEventHandler( "onPlayerVehicleEnter", root, function( veh, seat ) if seat == 0 then setElementData( source, "occupied_veh", veh, false ) end end ) addEventHandler( "onPlayerVehicleExit", root, function( veh, seat ) if seat == 0 and getElementData( source, "occupied_veh" ) == veh then setElementData( source, "occupied_veh", nil, false ) end end ) -- And here goes onPlayerWasted event: addEventHandler( "onPlayerWasted", root, function() local occupied_veh = getElementData( source, "occupied_veh" ) if occupied_veh and isElement( occupied_veh ) then destroyElement( occupied_veh ) end setElementData( source, "occupied_veh", nil, false ) end )
-
What happens when player is not inside a vehicle and dies? Thats right, getPedOccupiedVehicle() will return false and thus destroyElement() will also fail to execute. addEventHandler("onPlayerWasted", root, function() local veh = getPedOccupiedVehicle(source) if veh then destroyElement(veh) end end ) Btw: There is no difference between getRootElement() and root.