Yami
Mapper / Uczeń LUA
Wiek: 25 Na forum: 3059 dni Posty: 379
Piwa : 97
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." .. accName , aclGetGroup ( "RCON" ) ) then
return true
end
return false
end
function getAdminName ( player )
local accName = getAccountName ( getPlayerAccount ( player ) )
if accName and isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "Admin" )) and not isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "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." .. accName , aclGetGroup ( "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 ( text , v )
end
end
end
addEventHandler ( "onPlayerLogin" , root ,
function()
outputDebugString ( getPlayerName ( source ).. " has logged in!" )
local accName = getAccountName ( getPlayerAccount ( source ) )
if accName and isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "Support" ) ) then
setElementData ( source , "auth:support" , true )
end
end
)
function loggedOut ()
outputDebugString ( getPlayerName ( 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 c and c . id then kierowca_id = tonumber ( c . id ) end
end
gameView_add ( string . format ( "HOL pojazd %d holowany przez %d (kierowca %d)" , dbid2 , dbid1 , kierowca_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 ( login ) then
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 ( login ) then
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 ( login ) then
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:" , plr , 50 , 0 , 0 )
if ( #rcon>0) then
outputChatBox ( " " .. table . concat ( rcon , ", " ), plr )
else
outputChatBox ( " brak" , plr )
end
outputChatBox ( "Administratorzy:" , plr , 200 , 0 , 0 )
if ( #admini>0) then
outputChatBox ( " " .. table . concat ( admini , ", " ), plr )
else
outputChatBox ( " brak" , plr )
end
outputChatBox ( "Support:" , plr , 100 , 100 , 255 )
if ( #supporterzy>0) then
outputChatBox ( " " .. table . concat ( supporterzy , ", " ), plr )
else
outputChatBox ( " brak" , plr )
end
end
addCommandHandler ( "admins" , cmd_admins , false , false )
local function outputChatBoxSplitted ( text , target , c1 , c2 , c3 , ca )
if ( string . len ( text )< 128 ) then
outputChatBox ( text , target , c1 , c2 , c3 , ca )
return
end
local t = ""
for i , v in string . gmatch ( text , "(.)" ) do
if ( string . len ( t )> 0 and string . len ( t )+ string . len ( i )>= 128 ) then
outputChatBox ( t , target , c1 , c2 , c3 , ca )
t = " "
end
t = t .. i
end
if ( string . len ( t )> 0 and t ~= " " ) then
outputChatBox ( t , target , c1 , c2 , c3 , ca )
end
end
addCommandHandler ( "losowanie" ,function( player , cmd , yes , no )
if ( not yes ) or ( not no ) then 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 character ) then
outputChatBox ( "Najpierw do??cz do gry" , player , 255 , 0 , 0 , true )
return
end
local x , y , z = 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))" , v , 0x41 , 0x69 , 0xE1 , true )
triggerClientEvent ( v , "onCaptionedEvent" , root , message , 10 )
for i2 , v2 in ipairs ( getElementsByType ( "player" )) do
if ( getCameraTarget ( v2 )== v and v ~= v2 ) then
triggerClientEvent ( v2 , "onCaptionedEvent" , root , message , 10 )
outputChatBoxSplitted ( " * " .. message .. " #A0A0A0((" .. character . imie .. " " .. character . nazwisko .. " - /losowanie))" , v2 , 0x41 , 0x69 , 0xE1 , true ) -- aqq
end
end
end
end
destroyElement ( strefa )
end )
W tamtym temacie co pisa?em nie mog? pisa? odpowiedzi nie wiem dlaczego
I chcia?bym doda? ?e w lss-core ani nigdzie indziej nic nie zmienia?em ni? w tym co daje tutaj.