xXGhostXx Posted September 14, 2018 Share Posted September 14, 2018 Hello guys ! i have Problem ! On players join on server before download resources can play in server ! how to fix problem ? like : players after download resources can play in server ! please answer me Link to comment
xXGhostXx Posted September 14, 2018 Author Share Posted September 14, 2018 26 minutes ago, Dimos7 said: isTransferBoxActive Can you give me code ? Link to comment
JeViCo Posted September 15, 2018 Share Posted September 15, 2018 you're probably using default 'play' gamemode. It always spawns player when he/she joins the server. You should remove it and spawn players after you login in your login-panel resource. Don't forget about onClientPlayerWasted event to respawn player and return camera @xXGhostXx Link to comment
xXGhostXx Posted September 15, 2018 Author Share Posted September 15, 2018 3 hours ago, JeViCo said: you're probably using default 'play' gamemode. It always spawns player when he/she joins the server. You should remove it and spawn players after you login in your login-panel resource. Don't forget about onClientPlayerWasted event to respawn player and return camera @xXGhostXx No ! i writing game mode ! addEventHandler('onPlayerJoin', root, function () spawnPlayer(source, 1286.17578125, -1329.16015625, 13.55211353302) fadeCamera(source, true) setCameraTarget(source, source) end) local tempSkin; addEventHandler( "onPlayerWasted", getRootElement( ), function() tempSkin = getPlayerSkin ( source ) setTimer( respawnAfterDeath, 3000, 1, source ) end ) function respawnAfterDeath(source) spawnPlayer(source, 1286.17578125, -1329.16015625, 13.55211353302) setPlayerSkin(source, tempSkin) fadeCamera(source, true) setCameraTarget(source, source) end This code for my game mode ! please fix my script Link to comment
JeViCo Posted September 15, 2018 Share Posted September 15, 2018 (edited) @xXGhostXx remove this part of code and it'll solve your problem addEventHandler('onPlayerJoin', root, function () spawnPlayer(source, 1286.17578125, -1329.16015625, 13.55211353302) fadeCamera(source, true) setCameraTarget(source, source) end) this functions should be in your login-panel resource Edited September 15, 2018 by JeViCo Link to comment
xXGhostXx Posted September 15, 2018 Author Share Posted September 15, 2018 Just now, JeViCo said: @xXGhostXx remove this part of code and it'll solve your problem addEventHandler('onPlayerJoin', root, function () spawnPlayer(source, 1286.17578125, -1329.16015625, 13.55211353302) fadeCamera(source, true) setCameraTarget(source, source) end) What ?! How players join to server ? Link to comment
JeViCo Posted September 15, 2018 Share Posted September 15, 2018 5 minutes ago, xXGhostXx said: How players join to server ? what do you mean? Link to comment
xXGhostXx Posted September 15, 2018 Author Share Posted September 15, 2018 1 minute ago, JeViCo said: what do you mean? how players spawn after login ? Link to comment
JeViCo Posted September 15, 2018 Share Posted September 15, 2018 (edited) 2 minutes ago, xXGhostXx said: how players spawn after login ? ok then. Replace 'onPlayerJoin' with 'onPlayerLogin'. I thought players spawn when they join the server and respawn again after they login Edited September 15, 2018 by JeViCo Link to comment
xXGhostXx Posted September 15, 2018 Author Share Posted September 15, 2018 4 minutes ago, JeViCo said: ok then. Replace 'onPlayerJoin' with 'onPlayerLogin' Thanks ! But i have 5000$ in my cash and reset to 800$ because of on player login set player money has it, also skin players like this ! addEventHandler('onPlayerLogin', root, function () spawnPlayer(source, 1286.17578125, -1329.16015625, 13.55211353302) setPlayerSkin(source, 170) setPlayerMoney(source, 800) fadeCamera(source, true) setCameraTarget(source, source) end) please answer me Link to comment
JeViCo Posted September 15, 2018 Share Posted September 15, 2018 (edited) 2 hours ago, xXGhostXx said: But i have 5000$ in my cash and reset to 800$ If player joins the server for first time and get 5000$, you should look for givePlayerMoney or setPlayerMoney functions in your other resources because default value is 0 2 hours ago, xXGhostXx said: also skin players like this ! default skin is 0 (CJ) so that's normal Also you can make this shorter. Replace this spawnPlayer(source, 1286.17578125, -1329.16015625, 13.55211353302) setPlayerSkin(source, 170) with this local rot = 90 -- spawn rotation local skinID = 170 spawnPlayer(source, 1286.175+math.random(-1,1), -1329.160+math.random(-1,1), 13.552, rot, skinID) I also added +math.random(-1,1). It prevents players being stuck (when 2+ players spawn at the same time) Edited September 15, 2018 by JeViCo Link to comment
xXGhostXx Posted September 15, 2018 Author Share Posted September 15, 2018 3 minutes ago, JeViCo said: If player joins the server for first time and get 5000$, you should look for givePlayerMoney or setPlayerMoney functions in your other resources because default value is 0 default skin is 0 (CJ) so that's normal Also you can make this shorter. Replace this spawnPlayer(source, 1286.17578125, -1329.16015625, 13.55211353302) setPlayerSkin(source, 170) with this local rot = 90 -- spawn rotation local skinID = 170 spawnPlayer(source, 1286.175+math.random(-1,1), -1329.160+math.random(-1,1), 13.552, rot, skinID) I also added +math.random(-1,1). It prevents player sticking (when 2+ players spawn at the same time) please give me code Link to comment
JeViCo Posted September 15, 2018 Share Posted September 15, 2018 2 minutes ago, xXGhostXx said: please give me code Link to comment
xXGhostXx Posted September 15, 2018 Author Share Posted September 15, 2018 Just now, JeViCo said: Please edit my main code and give me code ! Link to comment
JeViCo Posted September 15, 2018 Share Posted September 15, 2018 addEventHandler('onPlayerLogin', root, function () local rot = 90 -- spawn rotation local skinID = 170 -- skin id spawnPlayer(source, 1286.175+math.random(-1,1), -1329.160+math.random(-1,1), 13.552, rot, skinID) local acc = getPlayerAccount(source) if not getAccountData(acc,"player:register") then -- set money if player joined the server for first time setPlayerMoney(source, 800) setAccountData(acc,"player:register",true) end fadeCamera(source, true) setCameraTarget(source, source) end) @xXGhostXx Link to comment
xXGhostXx Posted September 15, 2018 Author Share Posted September 15, 2018 24 minutes ago, JeViCo said: addEventHandler('onPlayerLogin', root, function () local rot = 90 -- spawn rotation local skinID = 170 -- skin id spawnPlayer(source, 1286.175+math.random(-1,1), -1329.160+math.random(-1,1), 13.552, rot, skinID) local acc = getPlayerAccount(source) if not getAccountData(acc,"player:register") then -- set money if player joined the server for first time setPlayerMoney(source, 800) setAccountData(acc,"player:register",true) end fadeCamera(source, true) setCameraTarget(source, source) end) @xXGhostXx Not work Link to comment
Mamad Rigel Posted September 17, 2018 Share Posted September 17, 2018 khob aval Akxe To Mizarm Ke Obne bish Nisti Harom Zade bache sal Madresatm 3 Roz Dg STart Mishe SIk kon Khob Barye Fix Kardan Spawn Player Bayd Ye khorde Khye Haye Khareji haro Bemali Khar kose Havasetm bashe Kos begi Zod Bala Saret Va MIkonm ye Solakh RO madaretDg Nari Beshini Poshe Man Harf Bezani Ha KOse Nanat Bb :D #Darcy http://uupload.ir/files/lwwv_photo_db_b2_db_b0_db_b1_db_b8_db_b0_db_b8_db_b2_db_b5_db_b1_db_b4_db_b2_db_b8_db_b3_db_b7.jpg 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