-
Posts
521 -
Joined
-
Last visited
Everything posted by Axel
-
Just epic.. +1 DarkLink Can you tell me what object are the claws?
-
setElementParent(obj,source) won t work... the object still doesn t dissapear
-
So i'm using the bone_attach ressource but i have a little issue, i attach objects to players, but when they quit the object remains in the air. I'v tried this it doesn't do nothing and no bug function destroyAttached () local attached = getAttachedElements(source) for i,v in ipairs (attached) do if exports.bone_attach:isElementAttachedToBone(v) then destroyElement(v) end end end addEventHandler("onPlayerQuit", getRootElement(),destroyAttached)
-
Yea.. my bad, function startMarker( hitPlayer ) if source == getcami then if ( getElementType(hitPlayer) == "player" and hitPlayer == localPlayer and not(isPedInVehicle(localPlayer)) ) then if (getElementData ( hitPlayer, "Occupation" ) == "Trucker") then guiSetVisible ( carrosw, true ) showCursor(true) end end end end addEventHandler ( "onClientMarkerHit", getRootElement(), startMarker)
-
Maybe this.. function startMarker( hitPlayer ) if ( getElementType(hitPlayer) == "player" and hitPlayer == localPlayer and not(isPedInVehicle(localPlayer)) ) then if (getElementData ( source, "Occupation" ) == "Trucker") then guiSetVisible ( carrosw, true ) showCursor(true) end end end addEventHandler ( "onClientMarkerHit", getRootElement(), startMarker)
-
The most logical way to make a job is setting the element data of the player "job" with the "Job name" and getting it whenever you want to setElementData getElementData Also there are all ready some jobs scripted on community, dunno how you missed them: https://community.multitheftauto.com/ind ... ls&id=2484 https://community.multitheftauto.com/ind ... ils&id=477 https://community.multitheftauto.com/ind ... ils&id=132 https://community.multitheftauto.com/ind ... ls&id=2053 https://community.multitheftauto.com/ind ... ls&id=2352
-
Use the f3 menu to spawn it.
-
About your bone_attach resource. If you enter an interior with the object on you it dissapears, if you exist it goes back. I fixed it, you forgot to check and set the object interior and dimension for the ped in bone_attach_c, function putAttachedElementsOnBone : local dimension = getElementDimension(ped) local interior = getElementInterior(ped) setElementDimension(element,dimension) setElementInterior(element,interior)
-
https://community.multitheftauto.com/ind ... ls&id=2604
-
About your drawtag ressource. How can i save the tags into an xml file or mysql table? Only saving the createElement arguments?
-
TwiX.. it's clear that the source is the colshape.. I'm getting the data i set with the mysql of the colshape.. And i want to get the radar area too, but that's the problem.. I don't know how can i do it.
-
Worked, thanks arezu, now how can i get the radar area turf when the player hits the colshape.. from this: mysql = exports.mysql addEventHandler( "onResourceStart", getResourceRootElement( ), function( ) local result = mysql:query("SELECT id, gang, c1, c2, c3, alpha, x, y, sx, sy FROM turfs") if (result) then local continue = true while continue do row = mysql:fetch_assoc(result) if not (row) then break end local id = tonumber(row["id"]) local gang = row["gang"] local x = tonumber(row["x"]) local y = tonumber(row["y"]) local sx = tonumber(row["sx"]) local sy = tonumber(row["sy"]) local c1 = tonumber(row["c1"]) local c2 = tonumber(row["c2"]) local c3 = tonumber(row["c3"]) local alpha = tonumber(row["alpha"]) local shape = createColRectangle(x, y, sx, sy) local turf = createRadarArea(x,y,sx,sy,c1,c2,c3,alpha) exports['armour']:changeProtectedElementDataEx(shape, "gang", gang) exports['armour']:changeProtectedElementDataEx(turf, "gang", gang) exports['armour']:changeProtectedElementDataEx(shape, "dbid", id) exports['armour']:changeProtectedElementDataEx(turf, "dbid", id) end mysql:free_result(result) end end ) function onEnter (thePlayer, matchingDimension) local shape = getElementData(source,"dbid") local gang = getElementData(source,"gang") if shape then if (getTeamName(getPlayerTeam(thePlayer)) == gang) then outputChatBox("Ai intrat pe teritoriul gangului "..gang.." ",thePlayer) else outputChatBox("Nu ai intrat",thePlayer) end end end addEventHandler("onColShapeHit", getRootElement(), onEnter)
-
So, i'm getting a strange error, I'm using getPlayerTeam and it returns a userdata , something like 00001FAC .... How can i get the actual player team? (getTeamFromName returns a boolean value..)
-
Is there a way to stop a animation and start an animation continuing the other one, and like that create other animations? If so, a simple example wold be nice.
-
I have just a small question, it maybe stupid but I'm curious about this: If i'll make a ressource that creates objects in-game and save them in MySQL and at the start of the ressource to load them all, will it count like map download or script download?
-
+1
-
You can eighter make a colshape in it and when a player hits it gets moved and when he leaves it get closed or i think you can use getDistanceBetweenPoints3D. https://wiki.multitheftauto.com/wiki/CreateColCircle https://wiki.multitheftauto.com/wiki/OnColShapeHit https://wiki.multitheftauto.com/wiki/OnColShapeLeave https://wiki.multitheftauto.com/wiki/Get ... enPoints3D
-
https://wiki.multitheftauto.com/wiki/SetPedRotation local af = createPed ( 287, 236.89999389648, 1970.6999511719, 18,800000, 0 ) setPedRotation(af, 360) -- change 360 however you want to
-
I think he means looking at a point. Well there is a function https://wiki.multitheftauto.com/wiki/SetPedLookAt I suggest using it to look at getLocalPlayer() function setLook() local x,y,z = getElementPosition(getLocalPlayer()) for i,v in ipairs(getElementsByType("ped")) do setPedLookAt(v,x,y,z,-1,getLocalPlayer()) end end addEventHandler("onResourceStart",getRootElement(),setLook) addEventHandler("onClientRender",getRootElement(),setLook) Note: It is not synced as it is clientside if there is 2 players they will see the ped looking at them.
-
local hudComponents = {"health","armour","ammo","weapon","money","wanted","crosshair","area_name","radar"} for i, n in pairs(hudComponents) do showPlayerHudComponent ( n, false ) end (client) function updateTime() local realTime = getRealTime() local hour = realTime.hour local minute = realTime.minute setMinuteDuration ( 60000 ) setTime( hour , minute ) end setTimer ( updateTime, 500, 1 ) setTimer ( updateTime, 3000000, 0 ) function constantTime() setTimer ( updateTime, 4000, 1 ) end addEventHandler ( "onResourceStart", getRootElement(), constantTime ) (server)
-
Are you sure you have the user ElMota's privileges?
-
This might work: addEventHandler("onResourceStart",resourceRoot, function () local infopointpickup = getElementsByType("pickup") for index, infopointpickup in pairs do local result = mysql:query_free("SELECT * FROM infopoints") if (result) then fnCreateInfo(infopointpickup["posx"], infopointpickup["posy"], infopointpickup["posz"], infopointpickup["message"]) end end end end) (if it doesn't tell me the error)
-
addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 4000, 1, source, 1177.5682373047, -1323.2587890625, 14.077121734619,0, getElementModel(source) ) outputChatBox ( getPlayerName ( source ).." died and was transported at All Saints Hospital.") end ) https://wiki.multitheftauto.com/wiki/SpawnPlayer
-
will, if you'r making your own RPG why you kept the "Gang" ?
