Jump to content

Flashmyname

Members
  • Posts

    31
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Flashmyname

  1. Nevermind, figured it out in the end.
  2. But it's also ruining it somehow, because player cannot be set back to it's root, because the way my script works, when the player attaches to vehicle, the player can be set to its child, but when it's not needed anymore the player cannot be set back to its root, or maybe I'm just using it wrong, I only need this parent stuff when the player is attached a.k.a part of the attachedPlayers table. The reason why I would want to reset it back to root is because when the car changes interior/dimension the player because he's still an active element of the car, gets teleported there too, even if he is detached and etc.
  3. Yeah it's working now, somehow I've had completely forgot about this function. Thanks for the help!
  4. Hi guys! lately I've bumped into a problem in my script, which I really can't have any ideas how to solve, or where did I :Oed up with the logic. It's not really the hardest thing to do, but I overcomplicated it somehow with the tables and stuff. The script is basically simple, you can attach/detach to a vehicle with a button press, and when the car moves into different interior/dimension then your character will follow it there, but get's detached because I couldn't really make it work, bugged out with attach or something. But the important stuff is that the interior change is actually working somehow, but the dimension didn't changed, no matter how I done it. local attachedPlayers = {} function handleInteriorDimensionChange(oldInterior, newInterior, oldDimension, newDimension) local vehicle = source local attachedElements = getAttachedElements(vehicle) for _, attachedElement in ipairs(attachedElements) do if getElementType(attachedElement) == "player" then local attachedPlayer = attachedElement triggerClientEvent("playerAnimationToClient", root, "", "", attachedPlayer) triggerClientEvent("stopUpdatingPlayerRotation", root, attachedPlayer) if oldInterior ~= newInterior then setElementInterior(attachedPlayer, newInterior) outputChatBox (inspect (attachedPlayer) .. "'s interior changed from " .. oldInterior .. " to " .. newInterior) end if oldDimension ~= newDimension then setElementDimension(attachedPlayer, newDimension) outputChatBox(inspect(attachedPlayer) .. "'s dimension changed from " .. oldDimension .. " to " .. newDimension) end detachElements(attachedPlayer, vehicle) setElementData(attachedPlayer, "attached", false) setElementData(attachedPlayer, "attachedVehicle", nil) setElementData(attachedPlayer, "attachmentPosition", nil) if attachmentPoint then attachmentPointsStatus[attachmentPoint] = false end end end end function getAttachedPlayers(vehicle) local attachedPlayers = {} local attachedElements = getAttachedElements(vehicle) for _, attachedElement in ipairs(attachedElements) do if getElementType(attachedElement) == "player" then table.insert(attachedPlayers, attachedElement) end end return attachedPlayers end
  5. You maybe should adjust the player height positions when starting descending at that specific position, just to suit your needs.
  6. Since I don't see the main things which are needed to make the original chat disappear in your code snippet, I will give you some code snippet improvements that you need to have in your code besides that you have right now. triggerClientEvent("onMessageIncome",source,""..message,0) local textsToDraw = {} local hideown local showtime local characteraddition addEvent("onMessageIncome",true) addEventHandler("onMessageIncome",getRootElement(),income) function income(message,messagetype) if source ~= getLocalPlayer() or not hideown then addText(source,message,messagetype) end end function addText(source,message,messagetype) local notfirst = false for i,v in ipairs(textsToDraw) do if v[1] == source then v[4] = v[4] + 1 notfirst = true end end local infotable = {source,message,messagetype,0} table.insert(textsToDraw,infotable) if not notfirst then setTimer(removeText,showtime + (#message * characteraddition),1,infotable) end end function sendMessageToClient(message,messagetype) if messagetype == 0 or messagetype == 2 then triggerClientEvent("onMessageIncome",source,message,messagetype) end function sendLocalSay(ped, msg) sendSay(ped, msg) end addCommandHandler("say", function (commandName, ...) if getElementData(localPlayer, "loggedIn") then sendSay(localPlayer, table.concat({...}, " "):gsub("#%x%x%x%x%x%x", "")) end end)
  7. I think I know a solution for it, it's really cheap and your idea in my opinion is the best because if you want something custom then definitely use that custom model, basically you need to define the two points then use the model, define the args exactly to match that length you need it to be. But if you wanna stay with the cheap solution then you should use these functions:(These functions are used in the first method you mentioned.) getDistanceBetweenPoints3D dxDrawLine3D
  8. You're welcome, let us know if you need some other help too with the script.
  9. I have some wild guess in the animation that you probably looking for, which might look like holding a zipline. "CAMERA", "picstnd_take"
  10. It's basically using combinations of binding a key and telling it what to do, then you need to render the fly sequence where you define which key does what, for example if the player presses up then it goes forward or something like that. You can use these: BindKey Math functions getCameraMatrix setElementPosition setElementRotation
  11. Flashmyname

    Help

    So you mean, that when you and your partner shoot each other then both character dies simultaneously?
  12. Flashmyname

    Help

    Can you provide more information on that "situation" that you mean? or some code snippet that will help us define the problem that you having?
  13. You can prioritize the resources which means two ways. The first way is to prioritize their download, so you can kinda line them up, which should be downloaded first and things like that. But I think you mean, you need to start the other resources first, then I recommend you create a serverside resourcestarter script, which basically will use timers and predefined args to make your own way of loading the needed resources.
  14. It doesn't work just like that, you should define what a 'hash' is, and what should be applied to. for example if you wanna encrypt your password while typing it in, you should use it somehow like this one. if string.find(details, "hash") then if length > 0 then hash = string.rep("•", length) end end
  15. Yeah I bet, but without proper info on these things, we cannot help and if somebody is not willing to do the search for it, then it is what it is.
  16. Try to look in to the code where it spawns the player, it's bugged out on unfreezing the player in my opinion, there is a code to freeze the player while the countdown is active but it's not working right because after the countdown is gone the player doesn't get unfreezed. You should check the debug for anything in that script and fix it. If you can provide some code snippet of that section, then I can help maybe.
  17. It's because of the weapon skill is set to maximum on the local server, you should change the values to 1000 then everything should work fine.
  18. Hi. Nyisd meg az MTA által létrehozott LUA fájlt ami a mappolást tartalmazza, és illeszd bele a következő sort, majd mentsd el. removeWorldModel (4215, 10000, 0, 0, 0) Restartold a scriptedet és a probléma megszűnik, ezek a fények is egy IDhez vannak kötve, tehát mappolás assetek, kiszedhetők csak az MTA Map Editornak is vannak határai.
  19. A törlés teljes mértékben kivitelezhető, viszont utána foltozgatni kell az adott maprészt, vizeket létrehozni az adott squareben és a többi. A szigetet cserét is meglehet oldani viszont valószínű hogy azt neked kell lemodellezni(már ha online nem találsz valami hasonlót) is beilleszteni úgy a pályára szintén kóddal ahogy neked azt ízlésed teszi.
  20. You have the knowledge for these things, im tellin' u. Good job!
  21. This problem can be blamed on the server's resource usage or due to the not optimized scripts, or you may found a bug in some script which causing this. So if you remember what exactly your partner did in the video before the sync fails(which caused the gun disappear, and looking like that what is shown in the video) and by fixing that code.. well that should do the trick i might say. Otherwise if its not caused by any ingame actions, so its like /natural/ then you should definitly look in to the server files, and monitor the usage of the resources, and do some debugging in them.
  22. Hi, here you go. - You need to use an EventHandler to make this work. local myMarker = createMarker ( xyz, "cylinder", 1, 255, 255, 0, 170 ) -- replace xyz with your exact coordinates. function giveMedicals(hitplayer, dimension) if isElement(hitplayer) and getElementType(hitplayer) == "player" then setElementHealth(hitplayer, 100) setPedArmor(hitplayer, 100) end end addEventHandler( "onMarkerHit", myMarker, giveMedicals )
  23. Hi! - i give you some hint to finish your code, this is an example. - in my version, you need to start this save protocol by an code, on clientside. -- CLIENTSIDE triggerServerEvent("loadCharacter", localPlayer, localPlayer) - -- SERVERSIDE function loadCharacter(player) triggerEvent("server:receiveStats", root, player) end addEvent("loadCharacter", true) addEventHandler("loadCharacter", root, loadCharacter) function saveAllPlayer() for _, player in ipairs(getElementsByType("player")) do saveOnePlayer(player) end end addEventHandler("onPlayerQuit", saveAllPlayer) setTimer(saveAllPlayer, 1000*60*30, 0) function saveAllPlayerCmd(p) for _, player in ipairs(getElementsByType("player")) do saveOnePlayer(player) end end addCommandHandler("saveall", saveAllPlayerCmd, false, false)
  24. Hi! - read this topic, it might helps you out. (Syncing custom animations.) I will give you a little preview of this on clientside, if something isn't clear after reading the topic that i linked above. local customAnimList = { ["facepalm"] = {file = "facepalm.ifp", customBlock = "realism", customName = "facepalm"}, --example } addEventHandler("onClientResourceStart", resourceRoot, function() for _, anim in pairs(customAnimList) do local ifp = engineLoadIFP("files/" .. anim.file, anim.customBlock) if not ifp then outputDebugString("Failed to load custom animation: ("..anim.file..")") end end end) addEvent("replaceCustomAnim", true) addEventHandler("replaceCustomAnim", root, function(internalBlockName, internalAnimName, customAnimName) engineReplaceAnimation(source, internalBlockName, internalAnimName, customAnimList[customAnimName].customBlock, customAnimList[customAnimName].customName) end) addEvent("restoreCustomAnim", true) addEventHandler("restoreCustomAnim", root, function() engineRestoreAnimation(source) end) addEvent("applyCustomAnim", true) addEventHandler("applyCustomAnim", root, function(customAnimName, time, loop, posUpdate) setPedAnimation(source, customAnimList[customAnimName].customBlock, customAnimList[customAnimName].customName, time, loop, posUpdate, false) end)
  25. Hi, you should try somehow like this. setTimer(function() if isPedInVehicle(localPlayer) and getPedOccupiedVehicle(localPlayer) then if getVehicleEngineState (getPedOccupiedVehicle(localPlayer)) then if tonumber(getPedOccupiedVehicle(localPlayer):getData("fuel") or 0) > 0 then else getPedOccupiedVehicle(localPlayer):setData("fuel",0) triggerServerEvent("vehicleStart",localPlayer,localPlayer,getPedOccupiedVehicle(localPlayer),false) end end end end,1000,0)
×
×
  • Create New...