Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 13/06/21 in all areas

  1. https://github.com/philippekwiatkowski/pk-mta-roleplay-scripts I released my scripts for an RP server a few years ago. Code is old, but the logic can be useful for learning. Cheers, PK
    1 point
  2. Pretty sure it exists (as anim you can use with setPedAnimation), but just like you I don't know it from the back of my head. Many GTA animations are named in a weird/obscure way, so you can't always figure out what something is based on its name (or the other way around, as in this case) so if it's out there you may have a hard time identifying it. GL! Well, maybe there's some tool in GTA modding world that can log whatever animation you play, or you could try to create such a tool. I have another last resort idea: you create a file debug.txt in MTA installation folder, launch MTA, and ask another player to shoot you with a sniper rifle (so you play the anim). Then, exactly while it's still playing, you crash MTA forcibly by holding left + right CTRL at the same time and releasing, which is what debug.txt is for. Now you can wonder: why? Because in MTA 1.5.7 some debug code was added, that logs the last played anim (block id and name) before MTA crashed. This was done to investigate animation crashes. But you can then open .dmp file from C:\Program Files (x86)\MTA San Andreas 1.5\MTA\dumps\private (right click > Edit in Notepad) and CTRL + F for this line: Current Animation Task Info Then you'll find the answer at the bottom, looking like this: And you can look up which anim name from https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/eAnimations.h (make sure to carefully read the index and group id's, as each has their own set of id's that can match across them) Really just depends on how far you want to take it
    1 point
  3. By the way, if the player suddenly jumps out of the car while driving at 100 kilometers speed, the sound may still work, you can add the following code line for this if(isPedInVehicle(localPlayer) == false) then setSoundPaused(soundChime, true) end
    1 point
  4. hello you can use timer I edited Tekken's code, you can do it like this function getElementSpeed(theElement, unit) -- Check arguments for errors assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")") local elementType = getElementType(theElement) assert(elementType == "player" or elementType == "ped" or elementType == "object" or elementType == "vehicle" or elementType == "projectile", "Invalid element type @ getElementSpeed (player/ped/object/vehicle/projectile expected, got " .. elementType .. ")") assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)") -- Default to m/s if no unit specified and 'ignore' argument type if the string contains a number unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit)) -- Setup our multiplier to convert the velocity to the specified unit local mult = (unit == 0 or unit == "m/s") and 50 or ((unit == 1 or unit == "km/h") and 180 or 111.84681456) -- Return the speed by calculating the length of the velocity vector, after converting the velocity to the specified unit return (Vector3(getElementVelocity(theElement)) * mult).length end local soundChime = playSound("speedchime.mp3", true, false) setSoundPaused(soundChime, true) function speedchime() local theVehicle = getPedOccupiedVehicle(localPlayer) if(theVehicle and getElementModel(theVehicle) == 560) then -- is player have vehice and id is 560 ? if(getElementSpeed(theVehicle, 1) >= 100) then -- is speed equal or greater then 100 ? if(isSoundPaused(soundChime) == true) then -- is sound Paused ? setSoundPaused(soundChime, false) -- play sound end else if(isSoundPaused(soundChime) == false) then -- is sound not paused setSoundPaused(soundChime, true) -- pause sound end end end end local soundStatusUpdater = setTimer(speedchime, 200, 0)
    1 point
  5. You will get a last chance, you know what would happen if you repeat things like that in the future. @sodilegnagyobbrajongoja
    1 point
  6. Hello, Here is the way I would have begin (tested in-game). Hope it can help. local screenW, screenH = guiGetScreenSize() local map_w = 1536 -- size of the map image (mine is 1536 x 1536) local game_w = 6000 -- equivalency with the game size (here whole gtasa map = 6000 x 6000) local radar_w = 400 -- size of the radar on screen local rt = dxCreateRenderTarget(map_w , map_w) -- same size of the map image addEventHandler("onClientRender", root, function() local x_game, y_game = getElementPosition(localPlayer) -- game positions of the player local x_map = (map_w * (x_game + 3000)) / game_w -- scale the x to map's resolution local y_map = -(map_w * (y_game + 3000)) / game_w -- scale the y to map's resolution -- player in-game position will be -3000 to +3000 for both axes, so I add +3000 to have proper relation between game size and map size -- I add a negative value to y_map. If not, the map will move in the wrong direction for Y axe (inverted) dxSetRenderTarget(rt,true) dxDrawImageSection(0, 0, map_w, map_w, x_map - (radar_w / 2), y_map - (radar_w / 2), radar_w, radar_w, "map.jpg") -- first it draws the whole map (0,0 to map_w, map_w). -- the section will be the size you want for the radar less the mid-distance to place the x, y player position to the center dxDrawCircle(map_w / 2, map_w / 2, 30) -- some circle drawn in the middle which symbolize the main player dxSetRenderTarget() dxDrawImage(screenW/2 - radar_w/2, screenH/2 - radar_w/2, radar_w, radar_w, rt); end ) Have a nice day.
    1 point
  7. Hey there, This is just a small showcase of how ATMs function as a part of the economy system, and some highlights of the primary features in the police system; these were created for my roleplay gamemode. I hope you enjoy! ATM System There are two types of ATMs that can be created: ones that support deposits and ones that don't - typically the ATMs that support depositing money are placed near banks. In the video below, you can see an example of withdrawing cash from an ATM, the process of depositing is the same except the animation just plays in reverse. There are also multiple ATM card types with different maximum withdrawal values for how much can be withdrawn from an ATM within the period of 24 hours. The ATM also features security such as automatically intaking the card if there are too many unsuccessful PIN attempts. The 'buttons' on the ATM are actually just dxDrawRectangle's created by the UI system and an event listener is triggered every time one of them is triggered, each button has its own element data so we can determine what key is being pressed. The animation for the money flowing in/out of the ATM is done by having seperate images for the cash flap and the money(the money image is actually always behind the flap out of view ready to come out!) so when we want to play the animation, the position of the flap image is raised using an easing function, and the same with the image of the cash moving down; then we simply listen for a click on the cash image to take it out and close the flap. ELS (Emergency Light System) There are multiple light patterns which exist for different vehicles, ranging from all emergency vehicles and also including others such as the Sultan, FBI Rancher, FBI Truck, etc. All strobe elements can be dynamically placed on vehicles in-game through a strobe editor. ALPR (Automatic License Plate Reader) This has the functionality to automatically search the plates of any vehicle that collides with the scanner hitbox, it automatically takes the vehicle's plates (if the vehicle has plates) and looks it up in the database for any existing flags, warrants, etc. and displays them on the vehicle information prompt, this lookup continues for every vehicle that passes and if a flag is found, the information is locked and retained on the display with an audio cue. There are two radars in the vehicle: one in the front and one in the rear, both can be customized to point to either the opposite lane that the vehicle is travelling on or the same lane. It also functions as a speedometer, any vehicle that drives past has its speed checked, and if the speed of the vehicle passing by is higher than what the 'Fast Limit' is as set by the player, then the violating vehicle's information is also locked and the ALPR operator is notified of the speed the vehicle was in excess of along with the direction they were heading - whilst all of this isn't demonstrated in the video, I might record and display this if there is interest for it. MDC System (Mobile Data Computer) The MDC is a fully responsive web application created with the intention of primarily being used on a web browser, though with Bootstrap it sizes quite nicely after being resized into a browser element placed into a small tablet on the screen, the small tablet version exists to allow quick navigation and usage though there is also a mobile data computer item in-game which can be used to open up a larger functional computer-style view for easier navigation. The web application itself is highly dynamic and created using PHP and Javascipt, most AJAX requests are made on the same page to prevent redirection such that the user can stay on the same page for each section (Civilian, Vehicle, Firearm, Property lookups) and also features a large amount of pop-up modals with a refreshing take on responsiveness.
    1 point
  8. https://www.youtube.com/watch?v=z7rvgBBtQo8 Credit goes out to a bunch of our loyal community members. Big thanks. Keep the spirit up.
    1 point
  9. As of February this year we've officially restarted this project with the addition of Unitts to our development team and a newly appointed server Manager Yoshira to fix up on our Management issues that occured when we launched & failed in 2020. This time we aim to make sure that the script is properly ready for the release and also have already done plenty of changes based on the feedback we've recieved back in 2020, we're making sure that the scripts end up being even more new user friendly as well as are reworking all the older scripts that were causing issues on release. In addition to that we're also going to actually force all the newly appointed members to go through an application process to avoid the problems that experienced roleplayers had with new people. With that said, we're also going to make sure that anyone that's new to Roleplay and had no previous experience with it before is also going to be able to contact one of our GameMasters which will be happy to teach them and prepare them for their new Roleplay experience in hopes of actually bringing more people to the MTA:SA (or GTA:SA overall) Roleplay scene. At the moment we're still in development and don't have a staff team set, but, unlike the first time we're actually going to hire experienced people to handle higher positions right on release so that way we don't end up with lack of support on either side of the Roleplay scene. Please note that we do not have a release date set and we're also not putting any pressure onto our development schedule this time to make sure that the script does end up being properly finished & ready for release with as little bugs as possible therefore we'd appreciate if you don't ask us about release date too much, we are, however, always ready to answer your questions so if you'd like to check us out and possibly chat with us feel free to join our Discord: https://discord.gg/2z8YNCefBZ We will make sure to post any updates we have there. Once we're ready we're also going to start with proper publications such as setting up the website & forums, posting news & updates on various social media (youtube, MTA:SA forum, our forums obviously) and so on. We're looking forward to seeing you, hopefully we'll manage to fix our previous mistakes this time and make sure you have a pleasant time with us!
    0 points
×
×
  • Create New...