Raised This Month: $51 Target: $400
 12% 

Get map size (width and length) and player positions


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-14-2022 , 21:13   Re: Get map size (width and length) and player positions
Reply With Quote #21

Quote:
Originally Posted by ghostdlr View Post
I downloaded the plugin from this post, that was already compiled:
https://forums.alliedmods.net/showthread.php?t=210029
If you clicked on the "Get Plugin" link, you did not download a plugin that was "already compiled". You downloaded the output of the compiler that executed immediately after you clicked the link using the source code that you would get if you clicked on "Get Source". When you upload a .sma file, it allows it to live compile the source code when you click on it. However, when the code has unknown/unsupported include files, it will fail and you'll get some random garbage file (which is why the file size is radically different than a plugin that actually compiles successfully).
__________________

Last edited by fysiks; 12-14-2022 at 21:14.
fysiks is offline
ghostdlr
Senior Member
Join Date: Aug 2010
Old 12-15-2022 , 10:24   Re: Get map size (width and length) and player positions
Reply With Quote #22

Here are the functions from onlinemap javascript:
Initial values of data.position[1] / [2] are the players in game coordinates as they are returned by amxmodx.

data.position[1] = (mapSize-((parseFloat(data.position[1]*mapZoom) + 4096)/8096)*mapSize);
data.position[0] = (mapSize-((parseFloat(data.position[0]*mapZoom) + 4096)/8096)*mapSize);
newDiv.style.left = Math.round(data.position[1]+(originTwo/8096*mapZoom)*mapSize) + 'px';
newDiv.style.top = Math.round(data.position[0]+(originOne/8096*mapZoom)*mapSize) + 'px';

This should translate into the margin top and margin left of the player icon but it's not accurate at all.
Not even the game displays the players in the proper locations when you spectate.

So i'm gonna give up on this for now, unless someone has a better idea.

Last edited by ghostdlr; 12-15-2022 at 10:24.
ghostdlr is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode