-
Posts
2,973 -
Joined
-
Last visited
-
Days Won
3
Everything posted by 50p
-
You can use interpolateBetween function that is very useful for your problem. https://wiki.multitheftauto.com/wiki/InterpolateBetween setCameraMatrix (117.5101852417, 163.30557250977, 5579.2065429688, 116.48139190674, 156.49519348145, 5579.0087890625) local progress = 0.0; -- value between 0 and 1 will be used to get the new position of camera (0.5 will be half way through between the 2 points) addEventHandler("onClientRender",root, function () if progress < 1 then progress = progress + 0.002; -- increase to move the camera faster end local x, y, z = interpolateBetween( 117.5101852417, 163.30557250977, 5579.2065429688, 120.94383239746,162.29713439941,5579.5678710938, progress, "Linear" ); setCameraMatrix (x, y, z, 116.48139190674, 156.49519348145, 5579.0087890625) end)
-
Make sure you run the resource. Also, make sure you're not getting any error/warning messages in debug window.
-
I did it but then if the timer get's killed, it get's killed for each players on the world. When you kill a timer you kill the specific timer (if it was for 1 player it will be killed for that player). Show us what you're having problem with and we'll explain. Do client-side scripting as little as possible (mainly GUI). If you can do something server-side then do it server-side.
-
Not all functions support it but if you read wiki you will see that default argument is getRootElement which is root. Even in the function description you can see the example showing the same thing as well as colour coding. Besides, getElementsByType is a slow function and if that is used very often then problems may occur. I am not sure if it has been changed to speed up the function but as far as I know, this function will loop through all elements created (by server or client) and get their type which may be slow if you have loads of objects, vehicles, players, markers, etc.
-
Can someone explain to me what's the point of looping through all players and sending the same message to all of them? Why not simply use root as the target (visibleTo)? outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message, root, 255, 255, 255, true)
-
Timers trigger functions. If you want the function to be called for specific player then use player element as argument for the function (server-side). Just like in the first Booo's example with outputChatBox func.
-
class.name is read from the spawn_locations.map file. That's the group name you need to add to acl.xml. Why don't you read my previous posts? This was just an example. If you don't have class with name "Police" don't add that group to acl.xml. Just add the groups that you want to restrict. If you haven't modified spawn_locations.map then you can try "Las Venturas Police" instead.
-
It's a client-side script, startResource is server-side only so clients can have this function name defined without any problems.
-
There is no need for it. If you really need one then you'll have to write it yourself.
-
end on line 63 is necessary but on 77 is not.
-
As far as I know, MTA blocks 3rd party Lua libraries for security reasons, so require will not load any lib.
-
It seems like it but why do you ask? Why don't you test and see for yourself?
-
Read my post again. ACL.xml is found in the server's directory.
-
Try this: -- make new line (21) in s_main.lua local classACL = aclGetGroup( class.name ); local plrAccount = getPlayerAccount( client ); if ( classACL and ( not isGuestAccount( plrAccount ) ) or ( not isObjectInACLGroup( "user." .. getAccountName( plrAccount ), classACL ) ) ) then outputChatBox( "You are not member of this team/gang. Please, choose different team!", client, 200, 50, 50 ); requestMenu( client ); return; end Also, make a new ACL group for each team (eg. team "Police") you want to restrict and add for each player inside that group: <group name="Police" > <object name="user.USERNAME" /> </group> Not tested but should work.
-
If you've got the code then you have to move the guiCreateStaticImage above the code where you draw text or use guiMoveToBack/guiBringToFront. If you're drawing text with DX functions then make sure that parameter postGUI is set to false.
-
It hasn't been implemented and most likely won't be. Can you explain a little more what you're trying to achieve?
-
Can you be more specific because I've fixed some syntax highlighting issues in the next release (NOT 0.3.4804). Thanks.
-
Added to the next release, just need testing. As in the reply to Cassandra. I added config.ini so that users can manually set their MTA path. I sent you a PM with a link to the testing version, let me know if the custom path that you set in config.ini fixes the problem for you. Thanks for report! EDIT: I just thought I'll post a little update on how things are going and I must admit they're going in the right direction! Thanks for all the reports I've had so far, they helped me to find and fix annoyance to the user. Hopefully fixed all the bugs that wouldn't allow users to start or edit their resources. Now, installer will ask you to specify paths to MTA server and client. Here is what will come in the next release which will come to the public in the next week or even this weekend: added: "File -> New -> Resource" will now open a window where user can input the most important resource info (author, version, etc.) to create a new resource added: Right-click a function definition from within a resource file (opened from Resource explorer) allows you to export the function from the resource (meta.xml: ) added: Context (right-click) menu for functions list on the right side of the window. Allowing you to call exported functions from other resources (you can also just double-click the function name) as well as going straight to the function definition added: Options window where you can change MTA paths if necessary added: Saving resource state in Resource Explorer - if you expand some folders and you switch to another resource switching back to previous resource will bring back old state of the resource; that is opened folders added: Config.ini file where main MTA:SE settings will be stored added: Full server integration; You can start/restart resources by clicking "Test resource" button changed: Installer will now ask you for MTA server and client paths. This way MTA:SE will have valid paths right from the start. changed: Installer won't overwrite file association. When running uninstaller it will bring the original file association that was used before installing MTA:SE (if you have already installed older version of MTA:SE more than once the file association will not be brought back, you will have to do it manually) fixed: Crash on some PC at start up. Doesn't crash any more, if it does please contact me immediately! fixed: Not loading any resources due to using wrong paths leading to non-MTA folders (installer will deal with this) fixed: Some syntax highlighter issues including Lua functions highlighting (eg. math.cos, string.format, etc.) Thanks to the tester who didn't give up on me and were patient enough to test all the test versions!
-
There was a function https://wiki.multitheftauto.com/wiki/IsObjectStatic but I'm not sure if it still works with newer MTA. Anyway, if object has some gravity properties then it will react to gravity otherwise you will have to script it yourself. To make smooth movement you'll need to use onClientRender and roughly calculate current frame position based on velocity and use setElementPosition instead of setElementVelocity.
-
You could use setElementVelocity with lower velocity. Doesn't setElementVelocity simulate physics/gravity?
-
If you got them shoot at the right angle then simply decrease its Z coord to make a fake gravity look.
-
People should read more carefully... "playerTeam" will be TEAM ELEMENT not a string representing team's name. You need to get team name to compare it to string. You will get warning messages otherwise. Also, lines from 19 to 25 will never be reached. Every player is in "Everyone" group so this is where the code will ignore other statements. One more thing, there is no point having 2 different onPlayerLogin handlers, especially when you're setting and getting account data. Event handlers are triggered asynchronously that means the order of the handlers being triggered is not always the same. For example, if you call cancelEvent function in the top handler, this doesn't necessarily mean that the handler below will not be triggered because it may have been triggered before the top one. https://wiki.multitheftauto.com/wiki/CancelEvent
-
I'm trying to think what you actually want to do.. I can't really think of the "camera angle" you're thinking about.
-
Line 17, wtf? playerTeam is a variable (team element or false) not a function... You can't use variables like if they were functions. You need to get the team's name and compare it with team names. You also need to call thesala function in your onPlayerSpawn callback.
-
You have to give function a name. You can't define function the way you did it, unless you assign it to a variable. So, you can change the line 3 to one of the following: myFunction = function( ) -- OR function myFunction( )