Wysłany: 2016-07-24, 18:58
xDanioPLx
LuA
Wiek: 24 Na forum: 4416 dni Posty: 24
Nick w MP: xDanioPLx
Piwa : 885
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 +
Kod:
addEventHandler ( "onPlayerChat" , root , function( tresc , msgtype )
if ( msgtype == 0 ) then
cancelEvent ()
local x , y , z = getElementPosition ( source )
for key , gracze in ipairs ( getElementsByType ( "player" )) do
local x2 , y2 , z2 = getElementPosition ( gracze )
if ( getDistanceBetweenPoints3D ( x , y , z , x2 , y2 , z2 )< 20 ) then
local int = getElementInterior ( source )
local dim = getElementDimension ( source )
local int2 = getElementInterior ( gracze )
local dim2 = getElementDimension ( gracze )
if ( int == int2 and dim == dim2 ) then
outputChatBox ( "#0000FF(" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ) .. ":#ffffff " .. tresc , gracze , 255 , 255 , 255 , true )
end
end
end
end
end )
Podpis
Los Santos Gaming MTA-60%
Wysłany: 2016-07-24, 19:01
GabWas
Wiek: 24 Na forum: 3881 dni Posty: 289
Nick w MP: GabWas
Piwa : 65
Więcej informacji znajdziesz w Wikipedii MTA: aclGetGroup
Wysłany: 2016-07-24, 19:28
xDanioPLx
LuA
Wiek: 24 Na forum: 4416 dni Posty: 24
Nick w MP: xDanioPLx
Piwa : 885
Zrobi??m tak ale nie dzia?a.
addEventHandler ( "onPlayerChat" , root , function( tresc , msgtype )
if ( msgtype == 0 ) then
cancelEvent ()
local x , y , z = getElementPosition ( source )
for key , gracze in ipairs ( getElementsByType ( "player" )) do
local x2 , y2 , z2 = getElementPosition ( gracze )
if ( getDistanceBetweenPoints3D ( x , y , z , x2 , y2 , z2 )< 20 ) then
local int = getElementInterior ( source )
local dim = getElementDimension ( source )
local int2 = getElementInterior ( gracze )
local dim2 = getElementDimension ( gracze )
if ( int == int2 and dim == dim2 ) then
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%
Wysłany: 2016-07-24, 19:50
GabWas
Wiek: 24 Na forum: 3881 dni Posty: 289
Nick w MP: GabWas
Piwa : 65
Sorki, poda?em z?? funkcj?. Powiniene? skorzysta? z:
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." .. accountname , aclGetGroup ( "Admin" )) then
setElementData ( plr , "ACLGroup" , "Admin" )
elseif isObjectInACLGroup ( "user." .. accountname , aclGetGroup ( "Moderator" )) then
setElementData ( plr , "ACLGroup" , "Moderator" )
elseif -- i tak dalej , wszystkie 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").
Wysłany: 2016-07-24, 20:04
xDanioPLx
LuA
Wiek: 24 Na forum: 4416 dni Posty: 24
Nick w MP: xDanioPLx
Piwa : 885
M?g?by? mi to jako? z kodem po??czy? bo niezabardzo wiem jak...?
Podpis
Los Santos Gaming MTA-60%
Wysłany: 2016-07-25, 22:08
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
xDanioPLx ,
grupy = {
{ acl = "Admin" , tag = "Admin" },
{ acl = "Moderator" , tag = "Mod" }
}
addEventHandler ( "onPlayerChat" , root , function( tresc , msgtype )
if ( msgtype == 0 ) then
cancelEvent ()
local x , y , z = getElementPosition ( source )
for key , gracze in ipairs ( getElementsByType ( "player" )) do
local x2 , y2 , z2 = getElementPosition ( gracze )
if ( getDistanceBetweenPoints3D ( x , y , z , x2 , y2 , z2 )< 20 ) then
local int = getElementInterior ( source )
local dim = getElementDimension ( source )
local int2 = getElementInterior ( gracze )
local dim2 = getElementDimension ( gracze )
if ( int == int2 and dim == dim2 ) then
for i , v in ipairs ( grupy ) do
if isObjectInACLGroup ( "user." .. accountname , aclGetGroup ( v . acl )) then
outputChatBox ( "[" .. v . tag .. "]#0000FF(" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ) .. ":#ffffff " .. tresc , gracze , 255 , 255 , 255 , true )
end
end
end
end
end
end
end )
Tagi: chat :: tagiem
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: