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

Wysłany: 2016-07-24, 18:58


xDanioPLx

LuA






Wiek: 24
Na forum: 4416 dni
Posty: 24
Nick w MP: xDanioPLx

Piwa: 885

Respekt: 40

Ostrzeżeń: 100%
Cze?? chce zrobi? id z tagiem mam kod na chat z id ale chce jeszcze do??czyc do tego tag czyli np (id)[Administrator]Nick gracza. Za pomoc daje :piwo: + R*

Kod:

addEventHandler("onPlayerChat"root, function(trescmsgtype)
    if (msgtype == 0then
        cancelEvent()
        local x,y,getElementPosition(source)
        for keygracze in ipairs(getElementsByType("player")) do
            local x2,y2,z2 getElementPosition(gracze)
            if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<20then
                local int getElementInterior(source)
                local dim getElementDimension(source)
                local int2 getElementInterior(gracze)
                local dim2 getElementDimension(gracze)
                                                                 
                if (int == int2 and dim == dim2then
                    outputChatBox("#0000FF("..getElementData(source,"id")..")#ffffff ".. getPlayerName(source) ..":#ffffff ".. trescgracze255255255true)
                       
                end
            end
        end
    end
end)


Podpis

Los Santos Gaming MTA-60%

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-24, 19:01


GabWas







Wiek: 24
Na forum: 3881 dni
Posty: 289
Nick w MP: GabWas

Piwa: 65

Respekt: 231,5
Respekt: 231,5Respekt: 231,5


Więcej informacji znajdziesz w Wikipedii MTA:

aclGetGroup


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-24, 19:28


xDanioPLx

LuA






Wiek: 24
Na forum: 4416 dni
Posty: 24
Nick w MP: xDanioPLx

Piwa: 885

Respekt: 40

Ostrzeżeń: 100%
Zrobi??m tak ale nie dzia?a.

addEventHandler("onPlayerChat"root, function(trescmsgtype)
    if (msgtype == 0then
        cancelEvent()
        local x,y,getElementPosition(source)
        for keygracze in ipairs(getElementsByType("player")) do
            local x2,y2,z2 getElementPosition(gracze)
            if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<20then
                local int getElementInterior(source)
                local dim getElementDimension(source)
                local int2 getElementInterior(gracze)
                local dim2 getElementDimension(gracze)
                                                                 
                if (int == int2 and dim == dim2then
                                aclGroupAddObject (aclGetGroup("Admin"), "user."..accountName))                       outputChatBox("#0000FF("..getElementData(source,"id")..")(accountName..getPlayerName(source) .."".. tresc, gracze, 255, 255, 255, true)   
                       
                end
            end
        end
    end
end)


Cos sie buguje tekst ustawiam go w dobrej linijce a on mi sie przesuwa.

Podpis

Los Santos Gaming MTA-60%

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-24, 19:50


GabWas







Wiek: 24
Na forum: 3881 dni
Posty: 289
Nick w MP: GabWas

Piwa: 65

Respekt: 231,5
Respekt: 231,5Respekt: 231,5

Sorki, poda?em z?? funkcj?. Powiniene? skorzysta? z:

Więcej informacji znajdziesz w Wikipedii MTA:

isObjectInACLGroup

Mo?esz dzi?ki niej stworzy? funkcj?, kt?ra b?dzie po kolei sprawdza? czy gracz jest w takiej i takiej grupie, a potem nada mu elementDat? w?a?nie z t? grup?. Co? na ten wz?r:
function getPlayerACLGroup(plr)
   accName getAccountName(getPlayerAccount(plr))
   if isObjectInACLGroup("user." .. accountnameaclGetGroup("Admin")) then
      setElementData(plr"ACLGroup""Admin")
   elseif isObjectInACLGroup("user." .. accountnameaclGetGroup("Moderator")) then
      setElementData(plr"ACLGroup""Moderator")
   elseif -- i tak dalejwszystkie grupy z ACL
end

Mo?esz se t? funkcj? wywo?ywa? przy wchodzeniu gracza na serwer (onPlayerJoin), a potem tylko ?eby pobra? rang? skorzysta? z getElementData(gracz, "ACLGroup").

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-24, 20:04


xDanioPLx

LuA






Wiek: 24
Na forum: 4416 dni
Posty: 24
Nick w MP: xDanioPLx

Piwa: 885

Respekt: 40

Ostrzeżeń: 100%
M?g?by? mi to jako? z kodem po??czy? bo niezabardzo wiem jak...?

Podpis

Los Santos Gaming MTA-60%

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:08


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

xDanioPLx,
grupy = {
    {acl="Admin"tag="Admin"},
    {acl="Moderator"tag="Mod"}
}

addEventHandler("onPlayerChat"root, function(trescmsgtype)
    if (msgtype == 0then
        cancelEvent()
        local x,y,getElementPosition(source)
        for keygracze in ipairs(getElementsByType("player")) do
            local x2,y2,z2 getElementPosition(gracze)
            if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<20then
                local int getElementInterior(source)
                local dim getElementDimension(source)
                local int2 getElementInterior(gracze)
                local dim2 getElementDimension(gracze)
                                                                 
                if (int == int2 and dim == dim2then
                                for iv in ipairs(grupy) do
                                    if isObjectInACLGroup("user." .. accountnameaclGetGroup(v.acl)) then
                                            outputChatBox("["..v.tag.."]#0000FF("..getElementData(source,"id")..")#ffffff ".. getPlayerName(source) ..":#ffffff ".. trescgracze255255255true)
                                    end
                                end    
                end
            end
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Tagi: chat :: tagiem
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » chat z id i tagiem 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