3B00DG4MER Posted March 12, 2014 Posted March 12, 2014 (edited) Hello,I made New System AFK IT's Work without Bugs But it doesn't get to Dimension 1 Server : function checkAFKPlayers() for index, thePlayer in ipairs(getElementsByType("player"))do -- Loop all online players if (getPlayerIdleTime(thePlayer) > 300000) then -- Player hasn't moved for 300,000ms (5 minutes) setElementDimension ( thePlayer, 1 ) outputChatBox("AFk Check") end end end setTimer(checkAFKPlayers, 30000, 0) -- Timer to execute every 30 seconds, checking for idlers Edited March 14, 2014 by Guest SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
Saml1er Posted March 12, 2014 Posted March 12, 2014 function DimensionP (player, dimension) if isPedInVehicle (player) then local veh = getPedOccupiedVehicle (player) setElementDimension ( player, dimension ) setElementDimension ( veh, dimension ) else setElementDimension ( player, dimension ) end return true end function checkAFKPlayers() for index, thePlayer in ipairs(getElementsByType("player"))do -- Loop all online players if (getPlayerIdleTime(thePlayer) > 300000) then -- Player hasn't moved for 300,000ms (5 minutes) DimensionP ( thePlayer, 1 ) outputChatBox("AFk Check") end end end setTimer(checkAFKPlayers, 30000, 0)
3B00DG4MER Posted March 13, 2014 Author Posted March 13, 2014 Can you made it if He Move will Go to Default Dimension setElementDimension ( thePlayer, 0 ) SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
Controlled Posted March 14, 2014 Posted March 14, 2014 function DimensionP (player, dimension) if isPedInVehicle (player) then local veh = getPedOccupiedVehicle (player) setElementDimension ( player, dimension ) setElementDimension ( veh, dimension ) else setElementDimension ( player, dimension ) end return true end function checkAFKPlayers() for index, thePlayer in ipairs(getElementsByType("player"))do -- Loop all online players if (getPlayerIdleTime(thePlayer) > 300000) then -- Player hasn't moved for 300,000ms (5 minutes) DimensionP ( thePlayer, 1 ) outputChatBox("AFk Check") elseif ( getElementDimension ( thePlayer) == 1 ) and (getPlayerIdleTime(thePlayer) < 300000) then setElementDimension ( thePlayer, 0) end end end setTimer(checkAFKPlayers, 30000, 0)
Ab-47 Posted March 14, 2014 Posted March 14, 2014 function checkAFKPlayers() for index, source in ipairs(getElementsByType("player"))do -- Loop all online players if (getPlayerIdleTime(source) > 300000) then -- Player hasn't moved for 300,000ms (5 minutes) DimensionP ( source, 1 ) outputChatBox("AFk Check") elseif ( getElementDimension ( source) == 1 ) and (getPlayerIdleTime(source) < 300000) then setElementDimension ( source, 0) end end end setTimer(checkAFKPlayers, 30000, 0) Try this, you haven't defined "thePlayer" either, but I replaced thePlayer with source which should get the local player. Not tested And now Aurora is back again, pm for more info. Ex. Lead dev & L6 Staff at AUR, NGC, MTA RP & SAA. Ex. Developer at Community of Social Gamers - CSG Ex Founder of International Gaming Community - IGC and Union of Individual Players- UIP Ab-47
Moderators Citizen Posted March 14, 2014 Moderators Posted March 14, 2014 you haven't defined "thePlayer" either It was defined in the for loop: for index, thePlayer in ipairs(getElementsByType("player")) do The rEvolution is coming ...
3B00DG4MER Posted March 14, 2014 Author Posted March 14, 2014 Can you lock it mod please SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
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