Jump to content

Buggy Spawning


.:HyPeX:.

Recommended Posts

Well, i can only make this work correctly if i restart the resource while im online and do /Lobby , if i reconnect i get buged up

(also the F1 bind isnt working).

  
  
Lobby = createTeam("#006677 - Lobby | Welcome - ") 
Missions = createTeam("#006677Missions | Co-Op") 
function SpawnPlayerToLobby(player,cmd) 
if source then 
bindKey(source, "F1", "down", "Lobby") 
fadeCamera(source, true) 
setPlayerTeam(source, Lobby) 
spawnPlayer(source, 493.45208740234, -23.21369934082, 1000, 0, 0, 17, 0) 
end 
if isElement(player) and getElementType(player) == "player" then 
spawnPlayer(player, 493.45208740234, -22.21369934082, 1000, 0, 0, 17, 0) 
setPlayerTeam(player, Lobby) 
fadeCamera(player, true) 
end 
end 
addEventHandler("onPlayerLogin", getRootElement(), SpawnPlayerToLobby) 
addCommandHandler("Lobby", SpawnPlayerToLobby) 

Link to comment

Try this:

  
local Lobby = createTeam("#006677 - Lobby | Welcome - ") 
local Missions = createTeam("#006677Missions | Co-Op") 
function SpawnPlayerToLobby(player,cmd) 
    if source then 
        bindKey(source, "F1", "down", "Lobby") 
        fadeCamera(source, true) 
        setPlayerTeam(source, Lobby) 
        spawnPlayer(source, 493.45208740234, -23.21369934082, 1000, 0, 0, 17, 0) 
    end 
    if isElement(player) and getElementType(player) == "player" then 
        spawnPlayer(player, 493.45208740234, -22.21369934082, 1000, 0, 0, 17, 0) 
        setPlayerTeam(player, Lobby) 
        fadeCamera(player, true) 
    end 
end 
addEventHandler("onPlayerLogin", getRootElement(), SpawnPlayerToLobby) 
addCommandHandler("Lobby", SpawnPlayerToLobby) 
  
addEventHandler( "onPlayerJoin", root, 
    function () 
        addEventHandler("onPlayerLogin", source, SpawnPlayerToLobby) 
        addCommandHandler("Lobby", SpawnPlayerToLobby) 
    end 
) 

Link to comment

How would that help? i'm being spawned but i cant see the bar (interior) and i see all objects "together" (The 2 peds on the bar are joined together infront of me, and i can see it becouse of their dxDrawText on their heads, but only the text, else just air)

EDIT: Pic:

8I4SAaV.png

Link to comment

Well after some days of trying came to a question:

Why does it work if im online and i restart the script (I'm starting the script via console and then logging in, and it works perfectly), but it doesnt if it is on and i come online (Without starting it with me online)?

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