Adde Posted March 10, 2013 Share Posted March 10, 2013 Hello, anyone that knows the problem if every player that register on my server spawns under the ground? Example: I set spawnpoint x, y, 11.563 on Navy ship in SF and they spawn in the water. Even if I set koordinate z from 11 to 20-30 or change position somewhere else on the map Link to comment
xXMADEXx Posted March 10, 2013 Share Posted March 10, 2013 Functions: onPlayerLogin -- Event setElementPosition -- Function Link to comment
Adde Posted March 10, 2013 Author Share Posted March 10, 2013 I have added setElementPosition now but player get stuck. Have to reconnect to die and then respawn function onPlayerSpawn (player) setPlayerTeam ( source, Military ) setElementPosition ( source, -1467.9906, 425.6120, 7.18 ) givePlayerMoney ( source, 2000 ) setPedArmor ( source, 60 ) setElementModel( source, 287 ) setPlayerNametagColor ( source, 0, 204, 0 ) end addEventHandler ( "onPlayerJoin", getRootElement(), onPlayerSpawn ) Link to comment
Tete omar Posted March 10, 2013 Share Posted March 10, 2013 I have added setElementPosition now but player get stuck. Have to reconnect to die and then respawn function onPlayerSpawn (player) setPlayerTeam ( source, Military ) setElementPosition ( source, -1467.9906, 425.6120, 7.18 ) givePlayerMoney ( source, 2000 ) setPedArmor ( source, 60 ) setElementModel( source, 287 ) setPlayerNametagColor ( source, 0, 204, 0 ) end addEventHandler ( "onPlayerJoin", getRootElement(), onPlayerSpawn ) function onSpawn() setPlayerTeam(source, Military) setElementPosition(source, -1467.9906, 425.6120, 7.18+5) givePlayerMoney(source, 2000) setPedArmor(source, 60) setElementModel(source, 287) setPlayerNametagColor(source, 0, 204, 0) end addEventHandler("onPlayerJoin", root, onSpawn) Are you sure there's a team-variable called 'Military'?, also 'onPlayerJoin' event has no parameter, try this one and tell me if works. Link to comment
Adde Posted March 10, 2013 Author Share Posted March 10, 2013 Na didn´t work, still stuck on spawn. But "7.18+5" made stuck in air Link to comment
PaiN^ Posted March 10, 2013 Share Posted March 10, 2013 Then it has to be something else in your code, Or the coordinates aren't correct .. Link to comment
Tete omar Posted March 10, 2013 Share Posted March 10, 2013 Na didn´t work, still stuck on spawn. But "7.18+5" made stuck in air Well, i tried ur code using 'runcode' script, and it works fine, the problem is yours, maybe the game-map hasn't loaded completely, or maybe your game is full of mods/custom cars, try to remove them all. Link to comment
DNL291 Posted March 10, 2013 Share Posted March 10, 2013 Use spawnPlayer instead of setElementPosition. Link to comment
Tete omar Posted March 10, 2013 Share Posted March 10, 2013 Use spawnPlayer instead of setElementPosition. You're right unless he's running freeroam. Link to comment
novo Posted March 11, 2013 Share Posted March 11, 2013 --Well, you can use setElementPosition(); --and then setPedSkin(); setElementModel(); Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now