Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 28/04/22 in all areas

  1. function changeWalkSettings (arg) toggleControl(source, "sprint", arg) toggleControl(source, "jump", arg) toggleControl(source, "aim_weapon", arg) toggleControl(source, "next_weapon", arg) toggleControl(source, "previous_weapon", arg) toggleControl(source, "fire", arg) toggleControl(source, "enter_exit", arg) end addEvent("changeWalkSettings", true) addEventHandler("changeWalkSettings", root, changeWalkSettings) --// In another script it will be like this triggerClientEvent(source, "changeWalkSettings", source, true or false) --// for client to server triggerServerEvent("changeWalkSettings", localPlayer, true or false) --// for server to client triggerEvent("changeWalkSettings", localPlayer, true or false) --// if you trigger the client function in another client script triggerEvent("changeWalkSettings", source, true or false) --// if you trigger the server function in another server script or via exports exports.theResourceWhereTheFunctionIs:theFunction(arguments) Example: exports.myScript:changeWalkSettings(true) If you want to use the export method you need to put in meta.xml this: <export function="changeWalkSettings" type="(client, server or shared)" /> ( type="client" will mean the function can be exported only in client scripts ) ( type="server" will mean the function can be exported only in server scripts ) ( type="shared" will mean the function can be exported in client and server scripts ) In my opinion, I recommend using the trigger method I hope I helped you
    1 point
  2. Hi. I wanted to share a new project with you ?
    1 point
  3. First, you don't need to convert the normal vectors to euler angles, beacuse the fxAddSparks function needs a direction vector that is exactly what normal vectors is. Second, you need to extend the TargetEndX/Y/Z values a bit because sometimes it's too short and the raycast returns false. For scaling: TargetEndX = TargetX + (TargetEndX - TargetX) * 5 TargetEndY = TargetY + (TargetEndY - TargetY) * 5 TargetEndZ = TargetZ + (TargetEndZ - TargetZ) * 5
    1 point
  4. very good house models, would be cool to have walls inside as well, atleast for toilet room haha but overall looks damn sexy, good job :3
    1 point
  5. wow, that is super nice model right there.. fits super good in SA world, and lighting is on point as well.. very good job haha
    1 point
  6. onClientElementDataChange, that is if you do not mis use elementdata. For example setting element data every frame. If the event onClientElementDataChange is triggered more than ~5x each second (9 func calls x 1s vs ~2 func calls each update, 9 / 2 = ~5). The timer will be more optimised than the event. (9x with different element data key) But in general the timer has a slower update timing, which should also taken in consideration.
    1 point
  7. Ladies and Gentlemen, I've been contemplating recording my gameplay for the last couple of years and I've finally decided to go for it. I'm making an MTA series where I go around and experience the servers and perhaps get some new players to join around the servers that I'll be visiting and revive MTA and why not start with the MTA server that is closest to my heart, SAES:RPG - Safe to say I've played here for the longest of time in my adolescence so I feel that it's my duty to introduce the players of MTA to this community. My friend Smallboss and I have returned recently to SAES hungry for some criminals to put behind bars... or in a coffin whichever is more feasible lol! I must warn you the first couple of videos will be a little short of editing as I am quite new to the whole Adobe Premiere video editing scene but I'm starting to warm myself to it as you'll see if you'll be watching the series. Be it if you're bored at work, in your leisure-time or you just want something to watch while eating I suggest you give it a watch, but enough talk. Follow the link below. https://www.youtube.com/playlist?list=PLgVINDYcbMrGT4ZZ_sIRGuUvi7u_BG_7d Feel free to leave any kinds of feedback - if you wanna be featured, Russell#1670 is the discord.
    1 point
  8. you can limit it by using root and using if command actually so you can handle it in a single eventhandler The nil error could possibly be because mark1 has not been created yet example: function markerHandler(hitElement, matchingDimension) if(getElementType(hitElement) == "player") then if(source == mark1) then --codes here for mark1 end if(source == mark2) then --codes here for mark2 end end end addEventHandler("onClientMarkerHit", root, markerHandler)
    1 point
  9. Hi MTA community recently I was browsing the useful functions list and I saw a new and interesting function available from version 1.5.8 r20704 onwards: attachElementToBone() and using the "onClientPedsProcessed" event. After seeing that this function gives better accuracy and better performance than 'bone_attach' resource I told myself why not making a new bonne attach resource, so this is what I did basically just using the function and the event I just created a synchronization between client and server with tables. Thank you to Einheit-101 and Saml1er for they’r hard work. Also thank you majqq for pointing me they’re credits! I called it attachToBones you can download it here: https://community.multitheftauto.com/index.php?p=resources&s=details&id=18372 GitHub (If you want to help): https://github.com/mihayy5/attachToBones It contains 2 server-side exported functions: attachElementToBone(theElement, thePed, boneID, offsetX, offsetY, offsetZ, rotationOffsetX, rotationOffsetY, rotationOffsetZ) theElement: The element which should be attached to the ped/player bone. Should work with any element that is supported by matrix functions. thePed: The ped or player which the element should be attached to. boneID: The target bone where the element should be attached to. offsetX: The X position offset from the bone. offsetY: The Y position offset from the bone. offsetZ: The Z position offset from the bone. rotationOffsetX: The rotation X-axis offset from the bone, in degree. rotationOffsetY: The rotation Y-axis offset from the bone, in degree. rotationOffsetZ: The rotation Z-axis offset from the bone, in degree. NOTE: rotationOffsetX, rotationOffsetY and rotationOffsetZ are automatically converted to radians! For a list of bone ID you can check the wiki page : attachElementToBone detachElementFromBone(element) element: The element which should be detached from the ped/player. VERY IMPORTANT ! THE OFFSETS ARE NOT COMPATIBLE WITH THE ONES FROM 'bone_attach' so you may have to rework all the positions. You can quickly test using those 2 test functions Code: /atest - to attach a sniper to player hand and a parachute to his back. /dtest - to detach them! Hope you find it useful! Cheers. P.S. PLEASE take note that I did not tested it with more than one player online so I will appreciate ALL feedback you can give!
    1 point
×
×
  • Create New...