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

Wysłany: 2018-02-27, 21:27


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3059 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235

Siema mam problem z /admins
Jak wpisze sie t? komende to pokazuje:
RCON:
Administratorzy:
Supporterzy:

I jak jestem w ACL w tym RCON to nie pokazuje mnie tam.
Bo wydaje mi si? ?e na XyzzyRP to s? po??czone kilka skrypt?w i dam tu kilka takich rzeczy i doradzicie co robic ?eby dzia?a?o?

lss-admin/base.lua

function isRCON(player)
    local accName getAccountName getPlayerAccount player ) )
    if accName and isObjectInACLGroup ("user."..accNameaclGetGroup "RCON" ) ) then
      return true
    end
    return false
end

function getAdminName(player)
    local accName getAccountName getPlayerAccount player ) )
    if accName and isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" )) and not isObjectInACLGroup ("user."..accNameaclGetGroup "Administrator" ))  then
        return "Zdalny"
    else
        return (getElementData(player,"auth:login") or getPlayerName(player))
    end
end

function isSupport(player)
    local accName getAccountName getPlayerAccount player ) )
    if accName and isObjectInACLGroup ("user."..accNameaclGetGroup "Support" ) ) then
      return true
    end
    return false
end

function msgToSupport(text)
  for i,v in ipairs(getElementsByType("player")) do
    if (getElementData(v,"auth:support")) then
        outputChatBox(textv)
    end
  end
end


addEventHandler("onPlayerLogin"root,
    function()
    outputDebugString(getPlayerName(source).." has logged in!")
    local accName getAccountName getPlayerAccount source ) )
    if accName and isObjectInACLGroup ("user."..accNameaclGetGroup "Support" ) ) then
        setElementData(source,"auth:support"true)
    end
    
    end
)

function loggedOut()
    outputDebugStringgetPlayerName(source) .. " wylogowa? si?")
    removeElementData(source,"auth:support")
end
addEventHandler("onPlayerLogout",getRootElement(),loggedOut)


addEventHandler("onTrailerAttach"root, function(poj)
    local dbid1=getElementData(poj,"dbid")
    local dbid2=getElementData(source,"dbid")
    if not dbid2 or not dbid1 then return end
    local kierowca=getVehicleController(poj)
    local kierowca_id=0
    if kierowca then
        local c=getElementData(kierowca,"character")
        if and c.id then kierowca_id=tonumber(c.idend
    end
    
    gameView_add(string.format("HOL pojazd %d holowany przez %d (kierowca %d)"dbid2dbid1kierowca_id))
end)


lss-core/command_misc

function cmd_admins(plr)
local supporterzy={}
local admini={}
local rcon={}
for i,v in ipairs(getElementsByType("player")) do
if (isRCON(v)) then
local t
local login=getElementData(v,"auth:login")
if (loginthen
t=login.."("..getElementData(v,"id")..")"
--[[
if (getElementData(v,"pmoff")) then
t=login.."(-)"
else
t=login.."("..getElementData(v,"id")..")"
end
]]--
table.insert(rcon,t)
end
elseif (isAdmin(v)) then
local t
local login=getElementData(v,"auth:login")
if (loginthen
t=login.."("..getElementData(v,"id")..")"
--[[
if (getElementData(v,"pmoff")) then
t=login.."(-)"
else
t=login.."("..getElementData(v,"id")..")"
end
]]--
table.insert(admini,t)
end
elseif (isSupport(v)) then
local t
local login=getElementData(v,"auth:login")
if (loginthen
t=login.."("..getElementData(v,"id")..")"
--[[
if (getElementData(v,"pmoff")) then
t=login.."(-)"
else
t=login.."("..getElementData(v,"id")..")"
end
]]--
table.insert(supporterzy,t)
end
end
end
outputChatBox("RCON:"plr50,0,0)
if (#rcon>0) then
outputChatBox(" " .. table.concat(rcon,", "), plr)
else
outputChatBox(" brak"plr)
end
outputChatBox("Administratorzy:"plr200,0,0)
if (#admini>0) then
outputChatBox(" " .. table.concat(admini,", "), plr)
else
outputChatBox(" brak"plr)
end
outputChatBox("Support:"plr100,100,255)
if (#supporterzy>0) then
outputChatBox(" " .. table.concat(supporterzy,", "), plr)
else
outputChatBox(" brak"plr)
end
end
addCommandHandler("admins"cmd_adminsfalsefalse)
local function outputChatBoxSplitted(texttargetc1,c2,c3ca)
if (string.len(text)<128then
outputChatBox(texttargetc1,c2,c3,ca)
return
end
local t=""
for i,v in string.gmatch(text,"(.)") do
if (string.len(t)>and string.len(t)+string.len(i)>=128then
outputChatBox(ttargetc1,c2,c3,ca)
t=" "
end
t=t..i
end
if (string.len(t)>and t~=" "then
outputChatBox(ttargetc1,c2,c3,ca)
end
end
addCommandHandler("losowanie",function(player,cmd,yes,no)
if (not yes) or (not nothen outputChatBox("(( /losowanie [JEZELI TAK] [JEZELI NIE] ))",player) return end
local rand math.random(1,2)
if rand==1 then --yes
message yes
else--no
message no
end
local character getElementData(player,"character")
if (not characterthen
outputChatBox("Najpierw do??cz do gry"player25500,true)
return
end
local x,y,getElementPosition(player)
exports["lss-admin"]:gameView_add("IC " .. character.imie .. " " .. character.nazwisko .. "/"..getPlayerID(player)..": /do - /losowanie " .. message)
local strefa createColSphere(x,y,z,30)
local gracze getElementsWithinColShape(strefa"player")
for i,v in ipairs(gracze) do
if (getElementInterior(v)==getElementInterior(player) and getElementDimension(v)==getElementDimension(player)) then
outputChatBoxSplitted" * " .. message .. " #A0A0A0((" .. character.imie .. " " .. character.nazwisko .. " - /losowanie))"v0x410x690xE1true)
triggerClientEvent(v"onCaptionedEvent"rootmessage10)
for i2,v2 in ipairs(getElementsByType("player")) do
if (getCameraTarget(v2)==and v~=v2then
triggerClientEvent(v2"onCaptionedEvent"rootmessage10)
outputChatBoxSplitted" * " .. message .. " #A0A0A0((" .. character.imie .. " " .. character.nazwisko .. " - /losowanie))"v20x410x690xE1true) -- aqq
end
end
end
end
destroyElement(strefa)
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-27, 22:33


Dexnes_

Tiger






Wiek: 26
Na forum: 4401 dni
Posty: 620
Nick w MP: Dexnes

Piwa: 1394

Respekt: 390
Respekt: 390Respekt: 390Respekt: 390Respekt: 390

Spr?buj doda? si? do ka?dej grupy ACL

Support,Administrator,RCON i daj zna? jaki efekt.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-28, 22:26


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3059 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235

wpisuj?c /admins nic si? nie dzieje

a w DB3: w DB3 pisze cos takiego:
ERROR: [XyzzyRP]/lss-core/commands_misc.lua:3: attempt to call global 'isRCON' (a nil value)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-01, 15:32


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

"ReMiK1337" napisał/a:

wpisuj?c /admins nic si? nie dzieje

a w DB3: w DB3 pisze cos takiego:
ERROR: [XyzzyRP]/lss-core/commands_misc.lua:3: attempt to call global 'isRCON' (a nil value)


W linijce 3 nie istnieje 'isRCON', nie posiada zawarto?ci

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-02, 12:11


karek







Wiek: 24
Na forum: 3326 dni
Posty: 7
Nick w MP: nieszporMonster



Respekt: 50

Najlepiej wklej od nowa ca?e lss-core

Podpis
qualityrpg.pl
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-02, 16:13


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3059 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235



Postaw piwo autorowi tego posta
 

 
Tagi: komenda :: /admins
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