EmaTheLegend Posted July 26, 2010 Share Posted July 26, 2010 I made a script for put player afk in basemode but he don't wark ! : function goafk(thePlayer) outputChatBox("** Thank you for using AFK Script by -RoCk-EmaLegend **", thePlayer) setElementHealth (thePlayer, 0) setPlayerTeam(thePlayer,Spectator) outputChatBox("** Your life now is 0: you are in SPECTATOR TEAM **", thePlayer) end addCommandHandler ("afk", goafk) the script must kill the player and move him in spectator team Link to comment
50p Posted July 26, 2010 Share Posted July 26, 2010 You need to understand what elements and element tree are in MTA. When you setPlayerTeam, you need player element (which you already have) and team element (which you don't have unless Spectator is an element). Use getTeamFromName to get team by its name. setPlayerTeam( thePlayer, getTeamFromName( "Spectator" ) ); -- make sure "Spectator" is correct team name Link to comment
EmaTheLegend Posted July 26, 2010 Author Share Posted July 26, 2010 thanks !!! It works great !! 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