Wysłany: 2014-10-11, 18:59
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
Witam! Chcia?bym zrobi?, aby megafon by?o wida? tylko do 50 metr?w. Pomo?ecie, nakierujecie?
addCommandHandler ( "m" ,
function( player , cmd , ...)
local accName = getAccountName ( getPlayerAccount ( player ) )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCMC" )) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCFD" )) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCSD" )) then
local message = table . concat ({ ... }, " " )
if #message > 0 then
outputChatBox ( "#5281B6MEGAFON>> #00FF09" .. message .. " #FFFFFF(( #BDC1BD" .. getPlayerName ( player ) .. " #FFFFFF))" , v , 0 , 255 , 0 , true )
end
end
end )
Wysłany: 2014-10-11, 19:13
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
createColSphere
getElementsWithinColShape
Wysłany: 2014-10-11, 19:17
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
addCommandHandler ( "m" ,
function( player , cmd , ...)
local accName = getAccountName ( getPlayerAccount ( player ) )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCMC" )) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCFD" )) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCSD" )) then
local message = table . concat ({ ... }, " " )
if #message > 0 then
local x , y , z = getElementPosition ( source )
local chatCol = createColSphere ( x , y , z , 50 )
local chatOdleglosc = getElementsWithinColShape ( chatCol )
for key , value in ipairs ( chatOdleglosc ) do
outputChatBox ( "#5281B6MEGAFON>> #00FF09" .. message .. " #FFFFFF(( #BDC1BD" .. getPlayerName ( player ) .. " #FFFFFF))" , v , 0 , 255 , 0 , true )
end
end
end ) Co tu jest nie tak?
Wysłany: 2014-10-11, 19:36
dudeks
Wiek: 31 Na forum: 6576 dni Posty: 171
Piwa : 89
if #message > 0 then
zamie? na
if message then
Wysłany: 2014-10-11, 20:10
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
Wysłany: 2014-10-12, 09:26
Vike4562
LUA <3
Wiek: 28 Na forum: 4937 dni Posty: 144
Nick w MP: Vike4562
Piwa : 32
Pierwsze co mi przysz?o do g?owy, to takie rozwi?zanie
addCommandHandler ( "m" ,
function( player , cmd , ...)
local accName = getAccountName ( getPlayerAccount ( player ) )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCMC" )) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCFD" )) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCSD" )) then
local message = table . concat ({ ... }, " " )
if #message > 0 then
for key , value in ipairs ( getElementsByType ( "player" )) do
local a , b , c = getElementPosition ( getLocalPlayer ())
local d , e , f = getElementPosition ( value )
if getDistanceBetweenPoints3D ( a , b , c , d , e , f ) <= 100 then
outputChatBox ( "#5281B6MEGAFON>> #00FF09" .. message .. " #FFFFFF(( #BDC1BD" .. getPlayerName ( player ) .. " #FFFFFF))" , v , 0 , 255 , 0 , true )
end
end
end
end )
Wysłany: 2014-10-12, 09:35
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
addCommandHandler ( "m" ,
function( player , cmd , ...)
local accName = getAccountName ( getPlayerAccount ( player ) )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCMC" )) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCFD" )) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "FCSD" )) then
local message = table . concat ({ ... }, " " )
if #message > 0 then
for key , value in ipairs ( getElementsByType ( "player" )) do
local a , b , c = getElementPosition ( player )
local d , e , f = getElementPosition ( value )
if getDistanceBetweenPoints3D ( a , b , c , d , e , f ) <= 100 then
outputChatBox ( "#5281B6MEGAFON>> #00FF09" .. message .. " #FFFFFF(( #BDC1BD" .. getPlayerName ( player ) .. " #FFFFFF))" , v , 0 , 255 , 0 , true )
end
end
end
end
end )
Przerobi?em troch?, ale nadal wywala wszystkim.
Wysłany: 2014-10-12, 09:36
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
x , y , z = getElementPosition ( gracz )
col = createColSphere ( x , y , z , 50 )
gracze = getElementsWithinColShape ( col , "player" )
for _ , v in ipairs ( gracze ) do
Kombinujecie jak ko? pod g?re.
Wysłany: 2014-10-12, 09:45
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
Wysłany: 2014-10-12, 11:16
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Niech zgadn?, skopiowa?e? na pa???
Wysłany: 2014-10-12, 13:00
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
niee ;D
[ Dodano : 2014-10-13, 22:26 ]
Jakie? pomys?y?
Tagi: czat :: kilku :: metrów
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: