-
Posts
2,973 -
Joined
-
Last visited
-
Days Won
3
Everything posted by 50p
-
Use split function.
-
If you open "server.lua" and scroll down to line 220, you should find a new event "onVehicleMod". This is triggered when you exit mod shop and your vehicle get modded. So, you can make your own resource and use this event to save upgrades. To get all the upgrades into 1 string, you have to iterate upgrades table and add the id to the string.. Something like: addEventHandler( "onVehicleMod", getRootElement(), function( upgrades ) local str = ""; for i, id in pairs( upgrades ) do str = str .. tostring( id ) .. ","; end str = str:sub( 1, -2 ); -- remove the last comma (,) local player = getVehicleOccupant( source ); setAccountData( getPlayerAccount( player ), "carupgrs", str ); end ) NOTE: You should make a check if player's account is guest account before you set its data.
-
Whatever keys you want... like "accelerate" or "break_reverse". addEventHandler( "onGamemodeMapStart", getRootElement( ), function( ) for i, plr in ipairs( getElementsByType( "player" ) ) do if not isKeyBound( plr, "down", "accelerate", unbindKeys ) then -- check if the keys have been bound already bindKeys( plr ); end end end ) function bindKeys( player ) setElementData( player, "overrideCollide.uniqueblah", 0, false ); bindKey( player, "down", "accelerate", unbindKeys ); bindKey( player, "down", "break_reverse", unbindKeys ); end function unbindKeys( player ) setElementData( player, "overrideCollide.uniqueblah", nil, false ); unbindKey( player, "down", "accelerate", unbindKeys ); unbindKey( player, "down", "break_reverse", unbindKeys ); end
-
Why don't you simply bindKey's and disable the AFK status when any of the bound keys are pressed?
-
You don't need to create an object then get its position and then get ground possition. Just use getGroundPosition( x, y, z ). When is this function called?
-
What type of variable is it? A table? Are you trying to modify my resource or make your own? Because there is a custom event that is triggered by modshop to let you do whatever you want when vehicle is upgraded... It is possible to store the upgrades in 1 line as a string.
-
For your information, I'm making a Vigilante 8 gamemode which is similar to Interstate69 but is based on a PSX game with the same name Vigilante 8. I'm currently modelling a few custom weapon models specially for this gamemode. NOTE: I'm not going to use this topic as my own so don't ask me questions about my gamemode here.
-
Why getElementsByType if you have a table of players already? getElementsByType is not as good as you may think it is. It's a slow function and if you have a table of players then use it instead.
-
http://sourceforge.net/projects/sqlitebrowser/
-
There are no polygon limits that I know of. The only limit is player's PC. @Doomed_Space_Marine I've been experiencing the same problem myself recently even though my models are very low poly and texture resolutions are not greater than 256x256. I load 5 models and after loading 6th model, FPS drops down from 36 (default limit set by server) to 25-26 and only a few of these models are streamed in. So, it has something to do with MTA rather than GTA or your PC.
-
And I thought you're smarter than you are. Do you know what debug means? Do you know what "bad argument" means? Then what else do you need to know?
-
aaaaaaaaaaaaaaaa my bad, thanks it worked now! thank you all who helped me. Edit: i got a problem, if i logout the data dosnt get saved Inside your function you getPlayerAccount but when player logs out, his account is a "guest" account. You should modify your function so it gets player's current account IF onPlayerQuit called this function and use player's previous account IF onPlayerLogout called this function. You can use another secret variable eventName to check which event called this function. Like: function onquitdb( prevAccount ) ... local index; if eventName == "onPlayerQuit" then index = getUserIndex (getAccountName(getPlayerAccount(source)),root) elseif eventName == "onPlayerLogout" then index = getUserIndex (getAccountName(prevAccount),root) end ... end
-
Yes, it's impossible. If you manage to load a file from a subfolder with just specifying "filename.xml" then it has to be an MTA bug which must be fixed as soon as possible! Since this is illogical. The file looks fine. Have you tried getResourceConfig instead?
-
It's not possible to load a file from a folder which you didn't specify in xmlLoadFile. Imagine having 2 files with the same name in the root folder and a subfolder. It's not logical that it'd load a file from folder with specifying only "filename.xml" as the file to load. Show your zones.xml file, it must be faulty if you can't load it.
-
You have to save the file. Where do you save it? xmlSaveFile
-
When you attach elements they are attached to one object with specific offset. If you offset it at 0,0,0 then it will be at the place of the element that you attach the element to. So, you need to offset it by the coords difference that these 2 elements are located to each other. You can solve it like so: local x,y,z = getElementPosition( object1 ); local xx,yy,zz = getElementPosition( object2 ); local offsetX, offsetY, offsetZ = x - xx, y - yy, z - zz; attachElements( object1, object2, offsetX, offsetY, offsetZ ); -- you may have to swap over object1 with object2
-
<config src="playerutils\zones.xml" type="client" /> ----- <config src="playerutils/zones.xml" type="client" /> I do not recommend you using "\" in xml files. "/" works on Windows as good as on *nix servers. Also, you tell server/client there is a file in "playerutils/" folder but when you load it, you just load from the root folder.
-
How do you spawn?
-
No.
-
So, how did you change it?
-
Or take a look into Race resource... It must have such function.
-
Create it yourself and consider yourself as a theft.
-
https://wiki.multitheftauto.com/wiki/GetTickCount - when he joins and when he leaves. You even have an example of how it'd work on that page.
-
You can disable commands in acl.xml. Making commands that start with ! is so unprofessional and old. Why would you want that?