Jump to content

[REQ]Radar refresh


Guest Noova

Recommended Posts

Hi

I'm using Freeroam GUI made by Arc and I have problem when somebody joins the server. Game creates a blip on radar that should be attached to that player, but somehow it isn't (it's stationary and points place where this player spawned). I think it has something to do with the spawning process that wants player to chose his place of spawn by clicking on the map. The effect of that is I can only track players that were on the server before I joined, because they pointed their spawn place earlier. The first player on the server sees nobody on the radar, and the last one's radar works properly.

I figured out that maybe removing everything from the radar and creating blips attached to players again by some script would solve this problem (I think about client side). I wonder if it's possible. It would be perfect if it could be binded to some key so I could refresh my radar by pressing a button, if not, console command would suffice. The thing is that I can track other players movement only by checking the full-scale map from GUI menu (it still shows correct players positions and movements) but it's uncomfortable. My guess is that players are showing properly only on the map because map wasn’t active when new player joined the server.

I’m new to MTA, and I’m a scripting noob, so I would be thankful if anyone could write me such a script, or even suggest any different solution to my problem.

Link to comment

I've got another idea. Maybe forcing player to spawn somewere right after he join the server without asking him where, will solve this problem. If anyone knows how to make it happen please write. It doesn't matter where he spawns if only it's somewere on solid ground. :)

Link to comment

Seems like an odd bug, I've not seen it reported before so please make sure it isn't a problem with the script. If it isn't, please post a small script/resource to reproduce or a set of clear steps.

Link to comment

The main problem is that I'm using pure unmodified "Freeroam GUI" v1.3 made by Arc_. It's available to download from Resources section on https://mtasa.com/ (exact link:https://community.multitheftauto.com/index.php?p=resources&s=details&id=43). Because I don't have any experience in scripting, and this Freeroam GUI is a complex set of many scripts, so I'm not sure where to start looking. I found something like this in fr_client.lua. I think it's responsible of spawning players after joining the server (or not, don’t know how to recognize that kind of stuff :) ).

--------------------------- 
-- Spawn map window 
--------------------------- 
function warpMapInit() 
    addEventHandler('onClientRender', g_Root, updatePlayerBlips) 
end 
  
function spawnMapDoubleClick(relX, relY) 
    setPlayerPosition(relX*6000 - 3000, 3000 - relY*6000, 0) 
    closeWindow(wndSpawnMap) 
end 
  
function closeSpawnMap() 
    showCursor(false) 
    removeEventHandler('onClientRender', g_Root, updatePlayerBlips) 
    for elem,data in pairs(g_PlayerData) do 
        for i,name in ipairs({'mapBlip', 'mapLabelShadow', 'mapLabel'}) do 
            if data.gui[name] then 
                destroyElement(data.gui[name]) 
                data.gui[name] = nil 
            end 
        end 
    end 
end 
  
wndSpawnMap = { 
    'wnd', 
    text = 'Select spawn position', 
    width = g_MapSide + 20, 
    controls = { 
        {'img', id='map', src='map.png', width=g_MapSide, height=g_MapSide, ondoubleclick=spawnMapDoubleClick}, 
        {'lbl', text='Welcome to freeroam. Double click a location on the map to spawn.', width=g_MapSide-60, align='center'}, 
        {'btn', id='close', closeswindow=true} 
    }, 
    oncreate = warpMapInit, 
    onclose = closeSpawnMap 
}  

It's only a small fragment of a lot bigger file. I don’t know is it enough to find out what’s wrong with my radar.

Maybe this will help: I've noticed that the radar blip is created before player was spawned. This blip doesn't change place after player finally appears somewhere on the map. I’m sorry that I can’t be more specific but I’m not a creator of this mod.

Link to comment
  • 3 weeks later...
  • 2 months later...

I am almost absolutely sure this has to do with the player not being fully spawned yet. I did some testing a few weeks ago that resulted in similar issues with the blip not being attached when it was created during the first time a player spawns (right after joining the server). The blip was created but never attached because apparently it had nothing to attach to. I solved this by auto-refreshing all player blips each time a player spawned.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...