Jump to content

Freeroam GUI


maxhamer

Recommended Posts

I am working on the Freeroam GUI resource. I need help in order to figure out how to make it so the map doesn't appear when the players join. Please can someone help me, it doesnt make any sense. I was thinking that it was run by the joinHandler but it appears that doesn't change anything.

Thanks in advance,

Maxhamer

Link to comment

In fr_client.lua there's a onClientResourceStart() handler. In there is what looks like a call to open the map selector (I don't use this resource so I'm guesstimating).

  
        if isPlayerDead(g_Me) then 
            createWindow(wndSpawnMap) 
            showCursor(true) 
        end 
  

Just get rid of those lines I suppose.

Link to comment

ok well that did certainly get rid of the map opening in the beginning. i have some spawn code, i would like to get it to use that under the same circumstances as the map opening but i was having a really hard time.

This is the spawn code I have:

function spawnThePlayer ( player ) 
    local where  = randInt(1,4) 
     
if ( where == 1 ) then 
        local spawn = spawnPlayer ( player, -294+randInt(0,10), 1025+randInt(0,10), 20, 90, randInt(9,288) ) 
     
elseif ( where == 2 ) then 
        local spawn = spawnPlayer ( player, -84+randInt(0,10), 1214+randInt(0,10), 20, 90, randInt(9,288) ) 
     
elseif ( where == 3 ) then 
        local spawn = spawnPlayer ( player, 83+randInt(0,10), 1172+randInt(0,10), 19, 90, randInt(9,288) ) 
     
else 
        local spawn = spawnPlayer ( player, -217+randInt(0,10), 994+randInt(0,10), 20, 90, randInt(9,288) ) 
    end 
    fadeCamera(player,true) 
end 
  

This is where the map opened.

    if isPlayerDead(g_Me) then 
             
        end 

What i tried to do it get that code directly into there but it appears to not work. Any help? It is really appreciated.

Max

Link to comment

When I told you to modify the script to remove the spawn map, that code is CLIENT side - the spawning of players is server-side only. So what you want is to remove the lines (as before) and put your new code in a server-side script. I've posted other code on this board for spawning players so have a look at that if you need to.

Edit:

  
addEventHandler('onPlayerJoin',gRoot, 
    function() 
                spawnThePlayer(source) 
    end 
) 
  

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...