Jump to content

Buggy Spawning


.:HyPeX:.

Recommended Posts

Posted

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) 

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted

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 
) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

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

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted

And, are you sure the problem is in that code?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

How would that help him? he wants the player to be in that interior.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

oh sorry. you can try use setElementInterior, or setElementDimension, if this interiors is in another dimension.

560x95_FFFFFF_09FF00_050505_000000.png

"Querer não é poder, mas tentar é avançar"!

Posted

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)?

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted

Quick bump and update: reading arround found out setCameraTarget was needed :/

Now it works, thanks for the help anyway.

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

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