Wysłany: 2015-11-11, 18:05
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Jakby tu zrobic aby by? widzialny tylko dla danej frakcji?
function message ( thePlayer , cmd ,...)
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAMC" ) ) then
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAPD" ) ) then
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PSP" ) ) then
local allArgs = {...}
local theMessage = table . concat ( allArgs , " " )
outputChatBox ( "#00ff00" .. getPlayerName ( thePlayer ).. " #ff0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 " .. theMessage .. "" , getRootElement (), 255 , 255 , 255 , true )
end
end
addCommandHandler ( "k" , message )
Wysłany: 2015-11-11, 18:09
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
P?tla na wszystkich graczy czyli:
for k , v in ipairs ( getElementsByType ( "player" ) do
w tej p?tli sprawdzasz czy gracz jest w jakim? acl, tylko, ?e ten gracz b?dzie oznaczany zmienn? "v" i je?eli jest to dajesz outputChatBox'a.
Je?eli chcesz mog? poda? Ci jaki? przyk?ad tego.
Wysłany: 2015-11-11, 18:31
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Jak mo?esz to daj jak to mia?oby mniej wi?cej wgl?da?
Wysłany: 2015-11-11, 18:42
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
function message ( thePlayer , cmd ,...)
if not getPlayerAccount ( thePlayer ) then return end
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if not accName then return end
local allArgs = {...}
local theMessage = table . concat ( allArgs , " " )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAMC" ) ) then
-- POCZATEK
for k , v in ipairs ( getElementsByType ( "player" )) do
if getPlayerAccount ( v ) then
accName = getAccountName ( getPlayerAccount ( v ))
if accName then
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAMC" )) then
outputChatBox ( "#00FF00" .. getPlayerName ( thePlayer ).. "#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 " .. theMessage , v , 255 , 255 , 255 , true )
end
end
end
end
-- KONIEC
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAPD" ) ) then
-- TUTAJ DODAJESZ DLA SAPD NA PRZYK ? ADZIE SAMC
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PSP" ) ) then
-- TUTAJ DODAJESZ DLA PSP NA PRZYK ? ADZIE SAMC
end
end
addCommandHandler ( "k" , message )
Wykona?em tutaj dla Ciebie chat dla SAMC, na podstawie tego musisz dorobi? sobie dla PSP i SAPD, dodatkowo w kodzie wyznaczy?em Ci w kt?rym miejscu zaczyna si? i ko?czy fragment odpowiedzialny za rozsy?anie wiadomo?ci do graczy.
Wysłany: 2015-11-11, 19:34
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
No co? nie tak z tymi endami
[2015-11-11 19] restart: Requested by Console
[2015-11-11 19] restart: Resource restarting...
[2015-11-11 19] Stopping test
[2015-11-11 19] Starting test
[2015-11-11 19] SCRIPT ERROR: test/script.lua:48: 'end' expected (to close 'if' at line 12) near '<eof>'
[2015-11-11 19] ERROR: Loading script failed: test/script.lua:48: 'end' expected (to close 'if' at line 12) near '<eof>'
[2015-11-11 19] test restarted successfully
function message ( thePlayer , cmd ,...)
if not getPlayerAccount ( thePlayer ) then return end
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if not accName then return end
local allArgs = {...}
local theMessage = table . concat ( allArgs , " " )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAMC" ) ) then
for k , v in ipairs ( getElementsByType ( "player" )) do
if getPlayerAccount ( v ) then
accName = getAccountName ( getPlayerAccount ( v ))
if accName then
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAMC" )) then
outputChatBox ( "#00FF00" .. getPlayerName ( thePlayer ).. "#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 " .. theMessage , v , 255 , 255 , 255 , true )
end
end
end
end
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAPD" ) ) then
for k , v in ipairs ( getElementsByType ( "player" )) do
if getPlayerAccount ( v ) then
accName = getAccountName ( getPlayerAccount ( v ))
if accName then
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAPD" )) then
outputChatBox ( "#00FF00" .. getPlayerName ( thePlayer ).. "#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 " .. theMessage , v , 255 , 255 , 255 , true )
end
end
end
end
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PSP" ) ) then
for k , v in ipairs ( getElementByType ( "player" )) do
if getPlayerAccount ( v ) then
accName = getAccountName ( getPlayerAccount ( v ))
if accName then
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PSP" )) then
outputChatBox ( "#00FF00" .. getPlayerName ( thePlayer ).. "#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 " .. theMessage , v , 255 , 255 , 255 , true )
end
end
end
end
addCommandHandler ( "l" , message )
Wysłany: 2015-11-11, 19:45
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
function message ( thePlayer , cmd ,...)
if not getPlayerAccount ( thePlayer ) then return end
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if not accName then return end
local allArgs = {...}
local theMessage = table . concat ( allArgs , " " )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAMC" ) ) then
for k , v in ipairs ( getElementsByType ( "player" )) do
if getPlayerAccount ( v ) then
accName = getAccountName ( getPlayerAccount ( v ))
if accName then
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAMC" )) then
outputChatBox ( "#00FF00" .. getPlayerName ( thePlayer ).. "#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 " .. theMessage , v , 255 , 255 , 255 , true )
end
end
end
end
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAPD" ) ) then
for k , v in ipairs ( getElementsByType ( "player" )) do
if getPlayerAccount ( v ) then
accName = getAccountName ( getPlayerAccount ( v ))
if accName then
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAPD" )) then
outputChatBox ( "#00FF00" .. getPlayerName ( thePlayer ).. "#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 " .. theMessage , v , 255 , 255 , 255 , true )
end
end
end
end
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PSP" ) ) then
for k , v in ipairs ( getElementsByType ( "player" )) do
if getPlayerAccount ( v ) then
accName = getAccountName ( getPlayerAccount ( v ))
if accName then
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PSP" )) then
outputChatBox ( "#00FF00" .. getPlayerName ( thePlayer ).. "#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 " .. theMessage , v , 255 , 255 , 255 , true )
end
end
end
end
end
end
addCommandHandler ( "l" , message )
Wysłany: 2015-11-18, 22:13
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Tagi: frakcje
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: