Wojak
Members-
Posts
321 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Wojak
-
You can attach the vehicle to an object and move the object (server side) you may achive a realistic efect, and it will be synced
-
Dobra robota moim zdaniem Polska społeczność MTA potrzebuje więcej artykułów na wiki w ojczystym języku Mam nadzieję że się nie poddasz
-
Carmageddon pedestrians for race resource This resource adds carmageddon like pedestrians to race maps (each ped must be added manually using the MTA map editor) How to use: -Load the carmapeds definitions in map editor -place the peds on the map -if you want the peds to go in the specific direction add the waypoint, then select the ped, pres F3, click on browse next to the “waypoint_id” property and select the waypoint from the list. Note: there should not be anything between the ped and the waypoint, you don’t need to add the waypoints – its optional. -add a line: To the map meta.xml file Note: adding this line to meta.xml file is important, if the resource is not working, you did not added this line! Also you should never start this resource manually (by using admin panel or /start command). Also you wont see the peds in the map editor test mode – you need to test the map on the server! DOWNLOAD: https://community.multitheftauto.com/ind ... ls&id=2592 Exemplar map: https://community.multitheftauto.com/ind ... ls&id=2593 Video: Info: This resource is not quite finished, it was on my hard drive for over a year, I recently decided to fix the critical errors and release it. Main features are: - new physics between pedestrians and vehicles - powerups when you run over the ped (not many though) - 3 types of ai (all very basic though: run away, fallow player and go to waypoint – the last one is used when you add the waypoint in the map editor, difrent ai will be triggered when you get close to the ped) - 4 types of peds (green – they always run away and give you a speed bust and a fix, when you hit them; red – this ones want to get run over, and something bad will happen when you kill them; yellow – random ai and random effect; blue – attempt to simulate realistic accident vehicle side) - Peds are created only where the action is, the player who is 1 in the race is responsible for creating the peds, when the number of peds reach 60 the oldest ones will be destroyed - Scripters may use the events: "onPanicPedHit" – for the green, "onRealPedHit" – for the blue, "onPsyhoPedHit" – for the red and "onRandomPedHit" for the yellow peds. The events are server side, the source is a root (so its not useful), the first parameter in the handler function is the ped that was killed, the second is the players vehicle. With a lithe creativity events may be used to add scoreboard columns or deathmassages outputs with no need to edit the resource itself. - Script is stabile, peds are synced, there may be some warnings in the console on special occasions, but it should not crasch. Special thanks to Slothman, author of the best ped resources I’ve sean in action. His resources inspired me, and bean a tutorial for me.
-
there is a bug in the dxDrawLine3D... you may use: getScreenFromWorldPosition dxDrawLine and you will have the same 3d efect:
-
bad news is, that there is no documentation on the wiki, or anywhere else by that mater... good news is that the source cod of edf and editor_main is not compiled this is the edf resource meta.xml, you may find list of exported functiond here: http://code.google.com/p/mtasa-resource ... f/meta.xml this is editor_main meta.xml with the list of expotred functions: http://code.google.com/p/mtasa-resource ... n/meta.xml you use expotred functions like this: exports.resource:function if you not shute how a function works, check it in the lua file... this is a search result of "edf trigger", pages should contain all events triggered by resource edf: http://www.google.com/codesearch#search ... -resources\.googlecode\.com this is a search result of "editor_main trigger", pages should contain all event triggered by resource editor_main: http://www.google.com/codesearch#search ... -resources\.googlecode\.com exemple: triggerClientEvent(rootElement, "onClientElementCreate", self.element) this is a 123 line in the editor_main/server/undoredo_action.lua the file is serverside and the function "triggerClientEvent" is used, so the event will be accessible client side, rootElement means: "for all clients", "onClientElementCreate" suggests that event will be triggerd when a element is created and self.element means that the source will be a element that was created of course you may check the context in the source code to be shure yes mapers can cheat... to prevent thet you may start by using this method: viewtopic.php?p=359450#p359450 in the edf script you must check ow many teleports there are (on edf load and on map load) if more then 4 you should decrease the number of teleprts by 4 an use the loop break method to destroy aditional teleports...
-
events are triggered by editor_main resouce. You may use events triggered by other resources in youre script (this is a very awesome MTA feature) As for the script- i tested it and it works
-
this is a working script, and a exemple how to debug scripts local passages = getElementsByType("passage") local npasages = table.getn(passages) addEvent("onClientElementCreate",true) addEventHandler("onClientElementCreate", root, function() outputChatBox("create: "..tostring(getElementType(source))) if getElementType(source) == "passage" then npasages = npasages + 1 outputChatBox(npasages) if npasages > 4 then setTimer(function() exports.editor_main:destroySelectedElement() end,100,1) outputChatBox("gamemode doesnt permit more than 4 teleports") end end end) addEvent("onClientElementDestroyed",true) addEventHandler("onClientElementDestroyed", root, function() outputChatBox("destroy: "..tostring(getElementType(source))) if getElementType(source) == "passage" then npasages = npasages - 1 outputChatBox(npasages) end end) note that there still may be a problem when you statr a new map... the table npasages should be reseted when the new map starts but "onNewMap" and "onMapOpened" are server only events (but you may trigger a clientside event from the server) edit: btw - you may use events triggered by other resources in youre script, you just need to know if a resource trigger something and what is the name of the event
-
i don't understand how can you be so trustful... z == 62.628402709961 z == 72.628402709961 and what if z will be somehow equal 72.628402709960 ? function onResourceStart() door = createObject(3095,1279.9134521484,-2054.0205078125,62.628402709961,0,271.07666015625,0) x,y,z = getElementPosition(door) dorstate = false end addEventHandler("onResourceStart", resourceRoot, onResourceStart) function move(thePlayer,cmd) if not dorstate then dorstate = true moveObject ( door, 10000, x, y, 72.628402709961 ) else outputChatBox("Door is already open",thePlayer,0,255,0,true) end end addCommandHandler ( "dooropen", move) function movez(thePlayer,cmd) if dorstate then dorstate = false moveObject ( door, 10000, x, y, 62.628402709961 ) outputChatBox("Door is already closed",thePlayer,0,255,0,true) else end end addCommandHandler ( "doorclose", movez)
-
I think the order is alphabetical, so you only can controll it by changing the names... as for the other thing: <element name="passage" friendlyname="Teleport" instructions="Place your teleport, emigrants need to reach USA!" icon="teleport.png" > <data name="position" type="coord3d" default="0,0,0" /> <data name="size" type="number" required="false" default="2"/> <data name="color" type="color" required="false" default="##0ff94dff" /> <data name="area" type="selection:outside,inside" required="false" default="outside" /> <marker type="cylinder" size="!size!" color="!color!" /> <marker size="0.5" type="cylinder" color="#ffff00ff" /> </element> but i don't really know how you going to make the teleport assignment user friendly, i used two diferent elements - one for the marker and other for destination viewtopic.php?f=108&t=32529
-
try to replace this: local x, y, z = getWorldFromScreenPosition(sX/2, sY/2, 10) local px, py, pz = getElementPosition(locplayer) setElementRotation(locplayer, 0, 0, findRotation(px, py, x, y)) with this: local x,y,z,px,py = getCameraMatrix() setPedRotation(locplayer, findRotation(px, py, x, y)) I can't belive that people are this lazy this days... edit: lol, actually i was wrong but this works fine: local sX, sY = guiGetScreenSize() local locplayer = getLocalPlayer() addEventHandler("onClientPreRender", root, function() local x, y, z = getWorldFromScreenPosition(sX/2, sY/2, 10) local px, py, pz = getElementPosition(locplayer) setElementRotation(locplayer, 0, 0,360- findRotation(px, py, x, y)) end) function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end return t end edit2 version wit camera matrix: local x,y,z,px,py = getCameraMatrix() setElementRotation(locplayer, 0, 0,180-findRotation(px, py, x, y))
-
there is nothing wrong with the edf file, there may be a typo in meta.xml, but i would have to create a lot of dummy files to test it...
-
https://wiki.multitheftauto.com/wiki/GetCameraMatrix https://wiki.multitheftauto.com/wiki/FindRotation
-
yes it's possible, i'm working on it... the octagon things are colltube and collcircle (i'm not planning to make it more round) the tangled thing is a fail atempt of drawing a sphere (fortunately all points are in correct places, so it can be fixed) polygons don't work yet so there is still a lot to do, be patient edit: in my opinion this is a sphere
-
local matrix = getElementMatrix(Vehicle) local x1 = 2 * matrix[1][1] + 0 * matrix[2][1] + 0 * matrix[3][1] + 1 * matrix[4][1] local y1 = 2 * matrix[1][2] + 0 * matrix[2][2] + 0 * matrix[3][2] + 1 * matrix[4][2] local z1 = 2 * matrix[1][3] + 0 * matrix[2][3] + 0 * matrix[3][3] + 1 * matrix[4][3] local x2 = -2 * matrix[1][1] + 0 * matrix[2][1] + 0 * matrix[3][1] + 1 * matrix[4][1] local y2 = -2 * matrix[1][2] + 0 * matrix[2][2] + 0 * matrix[3][2] + 1 * matrix[4][2] local z2 = -2 * matrix[1][3] + 0 * matrix[2][3] + 0 * matrix[3][3] + 1 * matrix[4][3]
-
each element can only have one direct parent, but it can have many children... the best thing that you can do is: <map> <parent1 id="x"> <spawnpoints> ... </spawnpoints> <parent2 id="y"> <cameras> ... </cameras> </parent2> </parent1> </map> event handlets and functions attached to parent1 will work for spawnpoints and cameras, the ones attached to parent2 will only work for cameras
-
you may try two things: 1) multiply the velocity (vx*2,vy*2,vz*2) 2) add vehicle velocity to rocket velocity and always remember to debug the script, that someone give you
-
g_P = getLocalPlayer() rocketTimer = false function rocket() local g_V = getPedOccupiedVehicle(g_P) local rotX,rotY,rotZ = getElementRotation(g_V) if not rocketTimer then local x, y, z = getElementPosition(occupiedVehicle) local matrix = getElementMatrix( g_V) local offX = 0 * matrix[1][1] + 1 * matrix[2][1] + 0 * matrix[3][1] + 1 * matrix[4][1] local offY = 0 * matrix[1][2] + 1 * matrix[2][2] + 0 * matrix[3][2] + 1 * matrix[4][2] local offZ = 0 * matrix[1][3] + 1 * matrix[2][3] + 0 * matrix[3][3] + 1 * matrix[4][3] vx = offX - x vy = offY - y vz = offZ - z x = 0 * matrix[1][1] + 3 * matrix[2][1] + 0 * matrix[3][1] + 1 * matrix[4][1] y = 0 * matrix[1][2] + 3 * matrix[2][2] + 0 * matrix[3][2] + 1 * matrix[4][2] z = 0 * matrix[1][3] + 3 * matrix[2][3] + 0 * matrix[3][3] + 1 * matrix[4][3] createProjectile(g_p, 19, x, y, z, 200, nil, 0, 0, 360 - rotZ, vx, vy, vz) rocketTimer = setTimer(function() rocketTimer = false end, 3000, 1) else outputChatBox("You must wait 3 seconds to fire again", 0, 255, 0, true) end end function onResourceStart() bindKey("lctrl", "down", rocket) end addEventHandler("onClientResourceStart", resourceRoot, onResourceStart) it should create rocket 3m infront of the center of vehicle
-
check this: https://forum.multitheftauto.com/viewtop ... cb#p353938
-
even if that animation doesn't exist, you may find something that looks similar in my opinion best way to find an animations id is by using the freroam panel - but it may take time though
-
Projekt Serwera Role Play
Wojak replied to Cichocki's topic in Poszukiwania i oferty graczy, reklamy serwerów
Wielkie projekty zaczyna się samemu i w tajemnicy, dopiero gry ma się coś do pokazania można założyć taki temat To że jest to twój pierwszy post na tym forum na pewno nie wzbudzi zaufania, co najwyżej pobudzi ludzi do krytyki... Co do samego konceptu - całkowite przemodelowanie świata może nawet zająć 100-500 MB (w zależności od wielkości siata i nie wliczając o plikach dźwiękowych), całość tych danych będzie ściągana przez graczy przy wejściu na serwer, więc jeśli nie stać cię na bardzo dobry hosting będziesz miał ciężko. Jeśli chodzi o tworzenie projektu jako grupa- jeśli sam nie znasz się na tworzeniu skryptów, nie będziesz potrafił zorganizować pracy innym, skończy się na tym że całość nie będzie się trzymać kupy, albo porostu będzie tak mało wydajna że nie będzie można grać (tworząc coś samemu najlepiej wiesz co i jak) No i oczywiście standardowa odpowiedź na tego typu tematy: "Większość dobrych skryptorów ma już zajęcie, i nie będą mieć czasu na nowe zobowiązania bez odpowiedniej motywacji (kasa)" -
I got some suggestions death system: maybe players will not die at all, they will just be seriously injured, and cant move, but a tembember could collect the body and bring him back to the base, where he will be cured as for the money, if you can nt think of anything, beyby give mony for time spendet on US territory (after all - land of opportunity )
-
the only logical explanation is that there is no player sitting in slot 1 (it may be slot 2 or 3) bad argument means that the element don't exist or is invalid (you may check it using isElement() function) If there is no player on slot 1, we can not use ipairs iterator (it is design only for tables indexed by integers starting from 1 with out skipping any number) for other tables we use pairs iterator, that will browse trough any index (lua tables can be indexed by anything except nil)
-
player in not attached to a blip, blip is attached to player, so uou need to use getAttachedElements this function returns a table
-
local entrada = getElementByID("entrada2") local prisao = getElementByID("prisao") local x,y,z = getElementPosition(prisao) function enviarParaPrisao(hitElement) if (getElementType(hitElement) == "vehicle") then local vtab = getVehicleOccupants(hitElement) if table.getn(vtab) < 1 than outputChatBox("no pasangers") end for i , deliver in ipairs(vtab) do setTimer(teleporte, 2000,1, deliver, hitElement) end end end dont know if it will work, but you may try...