Atti Posted January 8, 2008 Share Posted January 8, 2008 I just saw F11 map and i would know if it's scriptable and if so, how i do it. I've also noticed that this key isn't in this page: http://development.mtasa.com/index.php?title=Deathmatch_Client_Manual, so is it binded by a default resource? I can actually use it in all servers... Link to comment
eAi Posted January 9, 2008 Share Posted January 9, 2008 I don't believe it is scriptable, beyond the obvious things (like adding blips). What would you want to do with it? Feel free to add it to the manual Link to comment
Quest Posted January 9, 2008 Share Posted January 9, 2008 I personally would like to see an admin click and warp. Open the map click and POOF your there Link to comment
Guest Posted January 9, 2008 Share Posted January 9, 2008 I personally would like to see an admin click and warp. Open the map click and POOF your there Good idea. Link to comment
d0c Posted January 9, 2008 Share Posted January 9, 2008 I personally would like to see an admin click and warp. Open the map click and POOF your there I liked the idea, so I quickly coded a script that does exaclty that It's a client-only script that is invoked by the command "radarteleport". It displays the map inside a window and teleports you (or the car you're in) to the clicked position on the ground. A check allows to toggle if you want to go on the water or below. Works best if you bind a key to the command, like "bind n radarteleport". The script is missing any sort of protection, all players can use it. This is my first MTA script so don't be too hard Download Radar Teleport v1.0 (300kb, sorry for the additional copy of the map) @Devs: Bugs I stumbled over while writing this, and suggestions: - Relative GUI positioning seems a bit broken, placing the image at 0, 0, 1, 1 inside the window showed it cut-off at the top - I'm really missing a function to convert absolute screen coords to control-relative coords and vice-versa - Window alpha is only applied correctly if set after all controls are created - When teleporting, the car gets quite a spin, which sometimes makes you fall off your bike - getWaterLevel is a bit strange, as you basically need to know the water level before the call to get correct results Link to comment
eAi Posted January 10, 2008 Share Posted January 10, 2008 @Devs: Bugs I stumbled over while writing this, and suggestions: - Relative GUI positioning seems a bit broken, placing the image at 0, 0, 1, 1 inside the window showed it cut-off at the top I'd guess it includes the titlebar in it's height. This is fairly common with GUI systems but not exactly ideal... Is the percentage you have to offset it by to get it right consistent across different resolutions? - I'm really missing a function to convert absolute screen coords to control-relative coords and vice-versa That's easy enough to do yourself with the screen width/height - Window alpha is only applied correctly if set after all controls are created I've reported this - When teleporting, the car gets quite a spin, which sometimes makes you fall off your bike Not seen this. Try setting the velocity to 0 and spawning a bit above ground level (you can get the height of the vehicle using getDistanceFromCenterOfMassToBaseOfModel) - getWaterLevel is a bit strange, as you basically need to know the water level before the call to get correct results Not sure what you mean, it should be very reliable. Got a test case? You might want to try using testLineAgainstWater instead. It's worth noting that collision isn't loaded for areas you aren't in, so the processLineOfSight, getGroundPosition and getWaterLevel will be inaccurate. You can easily protect your radarteleport function by setting it's 'restricted' boolean to true by default. This means admins have to allow it explicitly in their ACL for the users who should have it. Link to comment
d0c Posted January 10, 2008 Share Posted January 10, 2008 I'd guess it includes the titlebar in it's height. This is fairly common with GUI systems but not exactly ideal... Is the percentage you have to offset it by to get it right consistent across different resolutions? I wonder why noone has reported this yet, as it seems even the devs of the included scripts had to struggle with this. When using relative coords, it's not consistent. Tested on 1280x1024 and 800x600 and y position was different. However the absolute size seems to be fixed to 19. That's easy enough to do yourself with the screen width/height That's not what I meant. If you have a deeply nested GUI and want to convert absoluteX/absoluteY from a click event to pixel coords relative to the upper-left corner of the control, that currently involves quite some calculation. Not seen this. Try setting the velocity to 0 and spawning a bit above ground level (you can get the height of the vehicle using getDistanceFromCenterOfMassToBaseOfModel) Easy to reproduce. Start broph, enter a banshee and call "setpos 0 0 100". Setting velocity/spin didn't seem to avoid this. Not sure what you mean, it should be very reliable. Got a test case? You might want to try using testLineAgainstWater instead. It's worth noting that collision isn't loaded for areas you aren't in, so the processLineOfSight, getGroundPosition and getWaterLevel will be inaccurate. You can easily protect your radarteleport function by setting it's 'restricted' boolean to true by default. This means admins have to allow it explicitly in their ACL for the users who should have it. I know about collision loading. However, when the data is loaded and call getWaterLevel(x, y, 50.0) it will return false even when the water level is 0 at (x, y). Perhaps testLineAgainstWater is the way to go, didn't test this. Link to comment
XetaQuake Posted February 9, 2008 Share Posted February 9, 2008 I personally would like to see an admin click and warp. Open the map click and POOF your there I liked the idea, so I quickly coded a script that does exaclty that It's a client-only script that is invoked by the command "radarteleport". It displays the map inside a window and teleports you (or the car you're in) to the clicked position on the ground. A check allows to toggle if you want to go on the water or below. Works best if you bind a key to the command, like "bind n radarteleport". The script is missing any sort of protection, all players can use it. This is my first MTA script so don't be too hard Download Radar Teleport v1.0 (300kb, sorry for the additional copy of the map) can someone say me what is here wrong: function keybind ( source ) bindKey ( source, "r", "down", clientToggleGui ) end addEventHandler( "keybind", clientToggleGui ) i want to show the "Radar Teleport" when i pressing "r" Link to comment
szlend Posted February 9, 2008 Share Posted February 9, 2008 Try function keybind ( source ) bindKey ( source, "r", "down", clientToggleGui ) end addEventHandler( "keybind", keybind ) Link to comment
szlend Posted February 9, 2008 Share Posted February 9, 2008 Whoops nevermind. The example i gave you above will bind the key when you type "/keybind" Do this instead: add bindKey ("r", "down", clientToggleGui) to the onClientResourceStart event function Link to comment
XetaQuake Posted February 9, 2008 Share Posted February 9, 2008 function keybind ( source ) bindKey ( source, "r", "down", clientToggleGui ) end addEventHandler( "onClientResourceStart", keybind ) dont work again onClientResourceStart have i allready tried befor i request help Link to comment
szlend Posted February 9, 2008 Share Posted February 9, 2008 Read this: http://development.mtasa.com/index.php? ... entHandler You forgot one parameter in addEventHandler. Also make sure you use this client side since "onClientResourceStart" is a client-side event. function keybind () bindKey ( "r", "down", clientToggleGui ) end addEventHandler( "onClientResourceStart", getRootElement(), keybind ) And btw, the client-side script doesn't need the source element. And type debugscript 3 in the console. It'll show all errors in your script Link to comment
XetaQuake Posted February 9, 2008 Share Posted February 9, 2008 thanks, now it works! and thanks for the info, because i am currently learning LUA BTW: have anybody a idea why the teleport map dont work on Capture the orb? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now