A poda?by? mi to w kodzie? W sensie, czy zrobisz mi, ?e po wpisaniu w ten EditBox i klikni?ciu wyslij wy?le wiadomo?? na czacie do ka?dego w acl OSP. Dam ci 4 .
for i,v in ipairs(getElementsByType("player")) do
if isObjectInACLGroup("user." .. getAccountName (getPlayerAccount(v)), aclGetGroup("NAZWA GRUPY")) then
-- bla bla
else
-- je?eli nie jest w acl
end
end
for i,v in ipairs(getElementsByType("player")) do
if isObjectInACLGroup("user." .. getAccountName (getPlayerAccount(v)), aclGetGroup("OSP")) then
addEventHandler ( "onClientGUIClick", wyslij, function ()
tekst = guiGetText ( tekst )
outputChatBox ( tekst )
end)
end
end
[ Dodano: 2014-11-10, 23:55 ]
A db3 jednak jest do tej lnikiji:
if isObjectInACLGroup("user." .. getAccountName (getPlayerAccount(v)), aclGetGroup("OSP")) then
A mianowicie:
attempt to call global 'getPlayerAccount' (a nil value)
to samo m?wi? co napisa? shuffle, ale no trzymaj...
addEventHandler ( "onClientGUIClick", wyslij, function ()
for i,v in ipairs(getElementsByType("player")) do
if isObjectInACLGroup("user." .. getAccountName (getPlayerAccount(v)), aclGetGroup("OSP")) then
tekst = guiGetText ( tekst )
outputChatBox ( tekst )
end
end
end)
Tak barany, u?ywajcie funkcji ACLowych po stronie klienckiej, brawo...
Dixers musisz zrobi? trigger na strone servera i tam wykonac kod.
C-side:
addEventHandler("onClientGUIClick", but, function()
local text = guiGetText(editbox)
triggerServerEvent("123", getLocalPlayer(), text)
end, false)
S-side:
addEvent("123", true)
addEventHandler("123", root, function(text)
for k,v in ipairs(getElementsByType("player")) do
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(v)), aclGetGroup("OSP")) then
outputChatBox("Wiadomo?? dla OSP: #ffffff"..text, v, 255, 0, 0, true)
end
end
end)
Shuffle, no sorry, ale tak napisa? miSplit, ?e w
"bla bla" my?la?em, ?e trzeba wklei? to co poda?e?. A podstawy znam -_-. Ka?dy pope?nia b??dy, cz?owiek nie jest nieomylny. Kiedy? sam na pewno taki by?e?, ?e robi?e? mas? b??d?w jak zaczyna?e?, a jak teraz nie robisz to kozak jeste?. To jest moja opinia....
A co do kodu Tostuch, to:
db3:
badArgument @'addEventHandler' [Expected element at argument 2, got nil]
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