FelipeMallmann Posted October 31, 2015 Posted October 31, 2015 (edited) Eai galera, estou com uma duvida de como posso fazer para verificar se o player está dentro de uma area. Minha ideia é quando ele morrer, pegar todos os players do server, verificar se eles estao dentro de uma area. addEventHandler ( "onPlayerWasted", root, function( player ) if turfElement[source] and source == turfElement[source][1] then local turf,area,id = unpack( turfElement[source] ) local players1 = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players1) do if ( --[[player está dentro da area--]] ) then --... --... end end end end ) a variavel da area é essa local turf,area,id = unpack( turfElement[source] ) Obrigado Edited November 4, 2015 by Guest
n3wage Posted October 31, 2015 Posted October 31, 2015 Com area você quer dizer uma radararea ? Se sim basta usar isInsideRadarArea. for theKey,thePlayer in ipairs(players1) do local posX, posY = getElementPosition( thePlayer ) if ( isInsideRadarArea ( variavel_da_area, posX, posY ) ) then --... --... end end
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