Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

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

Respekt: 1436,8
Respekt: 1436,8

Jakby tu zrobic aby by? widzialny tylko dla danej frakcji?






function message (thePlayer,cmd,...)
             local accName getAccountName getPlayerAccount thePlayer ) ) 
             elseif isObjectInACLGroup ("user."..accNameaclGetGroup("SAMC") ) then
                  elseif isObjectInACLGroup ("user."..accNameaclGetGroup("SAPD") ) then
     if isObjectInACLGroup ("user."..accNameaclGetGroup "PSP" ) ) then

            
            local allArgs = {...}
 
            local theMessage table.concat(allArgs" ")
            outputChatBox("#00ff00"..getPlayerName(thePlayer).." #ff0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 "..theMessage..""getRootElement(),255255255true)
            
            
            end
            end
            
            addCommandHandler("k"message)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-11, 18:09


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
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.

Postaw piwo autorowi tego posta
 

 
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

Respekt: 1436,8
Respekt: 1436,8

Jak mo?esz to daj jak to mia?oby mniej wi?cej wgl?da?

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-11, 18:42


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%

function message (thePlayer,cmd,...)
if not getPlayerAccount(thePlayerthen return end

local accName getAccountName getPlayerAccount thePlayer ) ) 
if not accName then return end

local allArgs = {...}
local theMessage table.concat(allArgs" ")


if isObjectInACLGroup ("user."..accNameaclGetGroup("SAMC") ) then
--POCZATEK
    for k,v in ipairs (getElementsByType("player")) do
        if getPlayerAccount(vthen
            accName getAccountName(getPlayerAccount(v))
            if accName then
                if isObjectInACLGroup("user."..accNameaclGetGroup("SAMC")) then
                outputChatBox("#00FF00"..getPlayerName(thePlayer).."#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 "..theMessagev255,255,255true)
                end
            end
        end
    end
--KONIEC
elseif isObjectInACLGroup ("user."..accNameaclGetGroup("SAPD") ) then
-- TUTAJ DODAJESZ DLA SAPD NA PRZYK?ADZIE SAMC
elseif isObjectInACLGroup ("user."..accNameaclGetGroup "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.

Postaw piwo autorowi tego posta
 

 
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

Respekt: 1436,8
Respekt: 1436,8

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(thePlayerthen return end

local accName getAccountName getPlayerAccount thePlayer ) ) 
if not accName then return end

local allArgs = {...}
local theMessage table.concat(allArgs" ")


if isObjectInACLGroup ("user."..accNameaclGetGroup("SAMC") ) then
    for k,v in ipairs (getElementsByType("player")) do
        if getPlayerAccount(vthen
            accName getAccountName(getPlayerAccount(v))
            if accName then
                if isObjectInACLGroup("user."..accNameaclGetGroup("SAMC")) then
                outputChatBox("#00FF00"..getPlayerName(thePlayer).."#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 "..theMessagev255,255,255true)
                end
            end
        end
end

elseif isObjectInACLGroup ("user."..accNameaclGetGroup("SAPD") ) then
for k,v in ipairs (getElementsByType("player")) do
        if getPlayerAccount(vthen
            accName getAccountName(getPlayerAccount(v))
            if accName then
                if isObjectInACLGroup("user."..accNameaclGetGroup("SAPD")) then
                outputChatBox("#00FF00"..getPlayerName(thePlayer).."#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 "..theMessagev255,255,255true)
                end
            end
        end
end

elseif isObjectInACLGroup ("user."..accNameaclGetGroup "PSP" ) ) then
for k,v in ipairs (getElementByType("player")) do
    if getPlayerAccount(vthen
        accName getAccountName(getPlayerAccount(v))
        if accName then
            if isObjectInACLGroup("user."..accNameaclGetGroup("PSP")) then
                outputChatBox("#00FF00"..getPlayerName(thePlayer).."#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 "..theMessagev255,255,255true)
            end
        end
    end
end

addCommandHandler("l"message)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-11, 19:45


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%

function message (thePlayer,cmd,...)
if not getPlayerAccount(thePlayerthen return end

local accName getAccountName getPlayerAccount thePlayer ) ) 
if not accName then return end

local allArgs = {...}
local theMessage table.concat(allArgs" ")


if isObjectInACLGroup ("user."..accNameaclGetGroup("SAMC") ) then
            for k,v in ipairs (getElementsByType("player")) do
                if getPlayerAccount(vthen
                    accName getAccountName(getPlayerAccount(v))
                    if accName then
                        if isObjectInACLGroup("user."..accNameaclGetGroup("SAMC")) then
                        outputChatBox("#00FF00"..getPlayerName(thePlayer).."#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 "..theMessagev255,255,255true)
                        end
                    end
                end
            end
    
elseif isObjectInACLGroup ("user."..accNameaclGetGroup("SAPD") ) then
            for k,v in ipairs (getElementsByType("player")) do
                if getPlayerAccount(vthen
                    accName getAccountName(getPlayerAccount(v))
                    if accName then
                        if isObjectInACLGroup("user."..accNameaclGetGroup("SAPD")) then
                        outputChatBox("#00FF00"..getPlayerName(thePlayer).."#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 "..theMessagev255,255,255true)
                        end
                    end
                end
            end
            
elseif isObjectInACLGroup ("user."..accNameaclGetGroup "PSP" ) ) then
            for k,v in ipairs (getElementsByType("player")) do
                if getPlayerAccount(vthen
                    accName getAccountName(getPlayerAccount(v))
                    if accName then
                        if isObjectInACLGroup("user."..accNameaclGetGroup("PSP")) then
                        outputChatBox("#00FF00"..getPlayerName(thePlayer).."#FF0000**#0000ffKr?tkofal?wka#ff0000**#FF6600 "..theMessagev255,255,255true)
                        end
                    end
                end
            end
end

end
addCommandHandler("l"message)



Postaw piwo autorowi tego posta
 

 
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

Respekt: 1436,8
Respekt: 1436,8

Mo?na zamkn??

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Tagi: frakcje
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku