Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. 1. You add function onDeathPickupHit to event handler but this function does not exist. 2. removeEventHandler requires a function handle to be removed. As mentioned before, try to change the respawn time of the pickup to something higher. It doesn't really matter how long because you may want to destroy it once a player hits it or timer will destroy it.
  2. local playerRecorderState = { } function togglePlayerRecorder( plr ) playerRecorderState[ plr ] = not playerRecorderState[ plr ]; -- first time player calls this function the state will be "true" so they'll have to press it again to hide chat and HUD showPlayerHudComponent( plr, "all", playerRecorderState[ plr ] ); showChat( plr, playerRecorderState[ plr ] ); end function bindRecorder( plr ) bindKey( plr, "home", "down", togglePlayerRecorder, plr ); -- change it to any key you want end addEventHandler( "onPlayerJoin", root, function ( ) bindRecorder( source ); end ) addEventHandler( "onResourceStart", resourceRoot, function( ) for _, plr in getElementsByType( "player" ) do bindRecorder( plr ); end end )
  3. You haven't explained what you're trying to do. Besides, you don't have to change collidable state every frame. That's overkill.
  4. Thanks for the comments guys. I appreciate all the feedback. I'll need to speak to some of you about the problems you described. I'll PM you guys to get more information. In the meantime try the new release which is 0.3.4851!
  5. MTA does support loading col shapes from map files and I thought you knew that since the start of this topic! When you said you can't retrieve radius I thought you mean that MTA does not load the radius from the map file. Anyway, here is all the reference info you'll need: https://wiki.multitheftauto.com/wiki/Colshape
  6. Use single equal sign (=) to assign a value to a variable. Use double equal signs (==) to compare if the 2 values are equal.
  7. If you're reading the .map file with XML functions but not loading it as a map (loadMapData or in meta.xml) then you have to set the element's data by attributes manually. So, even posX, posY and posZ is not stored in the colshape element (you can check for yourself). Anyway, you've done what I suggested and I'm glad you wrote the code yourself! Good luck with the script.
  8. In the server's console type: It should tell you some more information.
  9. 1. xmlNodeGetAttribute returns string so you have to convert the string to a number (tonumber) because createColSphere expects numbers. 2. You haven't explained what exactly doesn't work, you said you can't get radius but how do you know that? What makes you think that way?
  10. Don't make as a child of . This is confusing. <clans> <clan name="FBI"></clan> </clans> - 1 the most important thing you do but should not do is close the file inside a loop which was opened outside the loop. Do xmlSaveFile and xmlUnloadFile after you've done your operations. - You're trying to delete all the children. - Why do you use getElementData at the 2nd line if you don't even use the returned value anywhere in the code? - Check if the clan node (a child of ) is the same name as the clan you're trying to delete/destroy.
  11. You can use timers but I've heard many complaints about timers lagging. I'd do a constant check in case other resources use createProjectile and by delay I mean check tickcount between each check and then do the action, like: local iDelay = 300; local iLastCheckTick = 0; addEventHandler( "onClientRender", root, function() local iCurTick = getTickCount(); if iCurTick - iLastCheckTick > iDelay then -- check if current tick count minus last time check > delay (which is 300 in this case) -- DO ALL THE CHECKING HERE iLastCheckTick = iCurTick; -- assign the current tick as the last check tick count end end )
  12. Projectiles are elements. There is a function getElementsWithinColShape but it does not support projectiles. You can projectile's position to check if it's within the col shape and if it is then destroy the projectile (destroyElement). I'd use onClientRender and a little delay like 300ms. If you're having a shpere then it's easy to check if it's within colshape since there is a function getDistanceBetweenPoints3D (use colshape's and projectile's position) you can check if the distance is shorter than radius of the sphere colshape and destroy the projectile if it is. If it's a cylindrical (circle) shape then you can use getDistanceBetweenPoints2D (and use only X and Y coords). If the colshape is a rectangle then there is more calculating, you'd need to create a function like isPointInRectangle and and then compare the values (if projectile's X pos > left edge of rectangle and projectile's Y pos > top edge of rectangle and projectile's X < right edge of rectangle and projectile's Y pos < bottom edge of rectangle, then the projectile is within the rectangle). Similar for cuboids but with addition of Z. There is no other way I can think of.
  13. You would also need to check if the child of is the specific type because you could have rectangle but you'd still use createColCircle. That's just a tip to give you more flexibility for the future. If createCol... functions do create the shapes of the specific size then map integration needs to be fixed. Please report that on our bugs page: http://bugs.mtasa.com/main_page.php,
  14. Your folloutscript meta.xml contains inclusion of files that do not exists in the falloutscript folder. When you start/refresh the server and the resource can't be found when starting it, you have got a problem with meta.xml. So, first thing you do is validate the xml file (copy all the content of the file and use XML Validator), if you won't get any xml format problems then check if the files that you include actually exists in the resource folder/subfolders (whatever the path you used as src attribute). In your meta.xml you have these 2 lines: <map src="FalloutLosSantos.map" type="map" /> <map dimension="0" src="FalloutLosSantos.map"/> Both of these lines are pointless since you don't have the .map file in the same folder as meta.xml (that's the src is pointing) bysides, type="map" also has no use since nodes only supports 2 attributes (src and dimension). So remove the 2 lines and try again. If you want falloutscript to start with the FalloutLosSantos map then include "falloutscript" resource inside the FalloutLosSantos map's meta.xml as: <include resource="falloutscript" />
  15. Try showcol command and see its shape https://wiki.multitheftauto.com/wiki/Cl ... ds#showcol
  16. I don't think you can set cylinder's size that big. That must be GTA limit since cylinder markers are only used for missions so they are small. Like you said, it colshapes are better for your case since seeing 80 units wide marker would not be ideal. Also, collision of scaled objects will not scale with them, you can read about it on wiki:
  17. I have never used Zmodeller so I don't know how it works and I can't really help you any further. Is the cablecar treated as vehicle? If so, well I think you'll have to remove all the dummy objects from the scene, select the mesh (model) and try to export again. If you're exporting it as an object that will be used in GTA:SA then you should remove all the dummies because environment models in GTA:SA do not need any dummies. That's all I know, maybe Zmodeller does expect a dummy to specify model's pivot point. I don't know.
  18. https://wiki.multitheftauto.com/wiki/Se ... tagShowing
  19. setCameraTarget will not cause lag on its own. You must have something in the script which does the lag.
  20. By "extra functions" you mean addons that will let you import models? No, these importing tools are made by people like myself and most of them if not all, release these tools for free. You can also try Zmodeller which can import/export GTA:SA models.
  21. Conversion of 3D models is one of the easiest conversions when it comes to models themselves, since 3D model is just a mesh that shows on screen, but game engines use their own file format. Once you have a model in a 3D application (like 3DS Max), you can export it to GTA:SA format with KAM's scripts. It doesn't matter where you imported the model from, it can be any game or project, if you have a tool to import such file format then you can export it to GTA:SA (.dff) format. The only problem you may find is how you make them work. GTA:SA does not have any 'cablecar' functionality so you will have to script it yourself.
  22. You can store the elements within a table and then use getElementModel. You can use getElementByID if you previously used setElementID but you can't have more than 1 element with the same ID.
  23. removeWorldModel will clear the GTA map models. Then you can create your own world with map editor. The models created with createObject or nodes in map files will not be cleared. To remove these you will have to use destroyElement instead. If you're a 3D modeller and you want to create your own map and export custom models (.dff) then you can use my map exporter script for 3DS Max found here viewtopic.php?f=108&t=27406 I'm also working on a map importer as well. Here is a sample video:
  24. You have to flush/close the file. When you fileCreate a file it is stored in memory, once you fileClose it will appear in the folder. Always CLOSE opened files!
×
×
  • Create New...