Amine#TN Posted April 19, 2017 Posted April 19, 2017 function joinUnem() setPlayerTeam(source,"Civil") end addEventHandler("onPlayerLogin",getRootElement(),joinUnem) guys i want to make this script gives teams to the players without teams in my server only players without team
MTA Team Lpsd Posted April 19, 2017 MTA Team Posted April 19, 2017 (edited) function joinUnem() if not getPlayerTeam(source) then setPlayerTeam(source,getTeamFromName("Civil")) end end addEventHandler("onPlayerLogin",getRootElement(),joinUnem) Edited April 19, 2017 by LopSided_
TorNix~|nR Posted April 19, 2017 Posted April 19, 2017 (edited) Try this, it should work. local team = createTeam("Civil", 0, 0, 0) -- Create the team, (0, 0, 0) Change the team color if you want. addEventHandler("onPlayerLogin", getRootElement(), function () setPlayerTeam(source, getTeamFromName("Civil")) -- set team 'Civil' on player Join. end) Edited April 19, 2017 by TorNix~|nR
Amine#TN Posted April 19, 2017 Author Posted April 19, 2017 10 minutes ago, TorNix~|nR said: Try this, it should work. local team = createTeam("Civil", 0, 0, 0) -- Change the team color if you want addEventHandler("onPlayerLogin", getRootElement(), function () setPlayerTeam(source, getTeamFromName("Civil")) -- set team 'Civil' on playerJoin end) @TorNix~|nR that give the team for all the players with or without teams 21 minutes ago, LopSided_ said: function joinUnem() if not getPlayerTeam(source) then setPlayerTeam(source,getTeamFromName("Civil")) end end addEventHandler("onPlayerLogin",getRootElement(),joinUnem) that is not working
MTA Team Lpsd Posted April 19, 2017 MTA Team Posted April 19, 2017 try function joinUnem() if (getPlayerTeam(source) == false) then setPlayerTeam(source,getTeamFromName("Civil")) end end addEventHandler("onPlayerLogin",getRootElement(),joinUnem) If that doesn't work then you'll need to show more of your code, such as team creation.
Amine#TN Posted April 19, 2017 Author Posted April 19, 2017 i did not have a code i want just to give automatic team to players without team I have a semi RPG server you understand
MTA Team Lpsd Posted April 19, 2017 MTA Team Posted April 19, 2017 I assumed you already had the team setup. This'll work local team = createTeam("Civil", 0, 0, 0) -- Change the team color if you want function joinUnem() if (getPlayerTeam(source) == false) then setPlayerTeam(source,getTeamFromName("Civil")) end end addEventHandler("onPlayerLogin",getRootElement(),joinUnem)
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