FWCentral Posted December 20, 2011 Share Posted December 20, 2011 local team = getPlayerTeam(source) If i use this onPlayerSpawn then it doesn't get the team, is there any way around this? Note: When a player dies they lose there team and when they spawn they get a team from another resource. Link to comment
BinSlayer1 Posted December 20, 2011 Share Posted December 20, 2011 Delay everything for 1 or 2 seconds with setTimer() Link to comment
FWCentral Posted December 20, 2011 Author Share Posted December 20, 2011 (edited) It works fine now thank you! Edited December 20, 2011 by Guest Link to comment
bandi94 Posted December 20, 2011 Share Posted December 20, 2011 function asd(player) ......... end function timer() setTimer(asd,1000,1,source) end addEventHandler("onPlayerSpawn",getRootElement(),timer) Link to comment
FWCentral Posted December 20, 2011 Author Share Posted December 20, 2011 Sorry just edited my above post, Its working fine now thanks. Link to comment
yousseftawab Posted February 7, 2012 Share Posted February 7, 2012 Please help me I have the same Problem when the player dies he gets kicked out of his team and I don't understand what to do? Link to comment
Castillo Posted February 7, 2012 Share Posted February 7, 2012 -- server side: addEventHandler("onPlayerWasted",root, function () local team = getPlayerTeam(source) if (team) then setElementData(source,"tempTeam",getTeamName(team)) end end) addEventHandler("onPlayerSpawn",root, function () local team = getElementData(source,"tempTeam") if (team and getTeamFromName(team)) then setPlayerTeam(source,getTeamFromName(team)) end end) That script should save the team on wasted and load it on spawn. 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