mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 04:51:40 +09:00
Merge branch 'hotfix/4.0.2' into dev
This commit is contained in:
@@ -40,7 +40,7 @@ function Admin.jail(player,by_player,reason)
|
|||||||
['Reason:']=reason
|
['Reason:']=reason
|
||||||
} end
|
} end
|
||||||
Role.meta.last_jail = player.name
|
Role.meta.last_jail = player.name
|
||||||
player.vehicle = nil
|
player.driving = false
|
||||||
Server.interface(Role.assign,true,player,'Jail',by_player.name)
|
Server.interface(Role.assign,true,player,'Jail',by_player.name)
|
||||||
Server.interface(Role.unassign,true,player,Role.get(player),by_player.name)
|
Server.interface(Role.unassign,true,player,Role.get(player),by_player.name)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ commands.add_command('home', 'Allows you to set, remove and goto your homes', {
|
|||||||
if command == 'set' then
|
if command == 'set' then
|
||||||
local pos = {math.floor(player.position.x),math.floor(player.position.y)}
|
local pos = {math.floor(player.position.x),math.floor(player.position.y)}
|
||||||
if homes._n+1 > homes._m then player_return{'ExpGamingCommands-home.too-many-homes',homes._m} return commands.error end
|
if homes._n+1 > homes._m then player_return{'ExpGamingCommands-home.too-many-homes',homes._m} return commands.error end
|
||||||
|
if not homes[name] then homes._n=homes._n+1 end
|
||||||
homes[name] = pos
|
homes[name] = pos
|
||||||
homes._n=homes._n+1
|
|
||||||
player_return{'ExpGamingCommands-home.set',name,pos[1],pos[2]}
|
player_return{'ExpGamingCommands-home.set',name,pos[1],pos[2]}
|
||||||
elseif command == 'remove' then
|
elseif command == 'remove' then
|
||||||
if not homes[name] then player_return{'ExpGamingCommands-home.invalid',name} return commands.error end
|
if not homes[name] then player_return{'ExpGamingCommands-home.invalid',name} return commands.error end
|
||||||
|
|||||||
@@ -162,7 +162,8 @@ Role{
|
|||||||
tag='[Partner]',
|
tag='[Partner]',
|
||||||
group='HiMember',
|
group='HiMember',
|
||||||
colour={r=140,g=120,b=200},
|
colour={r=140,g=120,b=200},
|
||||||
allow_afk_kick=true,
|
allow_afk_kick=false,
|
||||||
|
is_spectator=true,
|
||||||
allow={
|
allow={
|
||||||
['global-chat']=true,
|
['global-chat']=true,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,16 +116,16 @@ function ExpLib.player_return(rtn,colour,player)
|
|||||||
colour = ExpLib.is_type(colour,'table') and colour or defines.textcolor[colour] ~= defines.color.white and defines.textcolor[colour] or defines.color[colour]
|
colour = ExpLib.is_type(colour,'table') and colour or defines.textcolor[colour] ~= defines.color.white and defines.textcolor[colour] or defines.color[colour]
|
||||||
player = player or game.player
|
player = player or game.player
|
||||||
local function _return(callback,rtn)
|
local function _return(callback,rtn)
|
||||||
if ExpLib.is_type(rtn,'table') then
|
if ExpLib.is_type(rtn,'table',use_colour) then
|
||||||
-- test for: userdata, locale string, table with __tostring meta method, any other table
|
-- test for: userdata, locale string, table with __tostring meta method, any other table
|
||||||
if ExpLib.is_type(rtn.__self,'userdata') then callback('Cant Display Userdata',colour)
|
if ExpLib.is_type(rtn.__self,'userdata') then callback('Cant Display Userdata',use_colour)
|
||||||
elseif ExpLib.is_type(rtn[1],'string') and string.find(rtn[1],'.+[.].+') and not string.find(rtn[1],'%s') then callback(rtn,colour)
|
elseif ExpLib.is_type(rtn[1],'string') and string.find(rtn[1],'.+[.].+') and not string.find(rtn[1],'%s') then callback(rtn,use_colour)
|
||||||
elseif getmetatable(rtn) ~= nil and not tostring(rtn):find('table: 0x') then callback(tostring(rtn),colour)
|
elseif getmetatable(rtn) ~= nil and not tostring(rtn):find('table: 0x') then callback(tostring(rtn),use_colour)
|
||||||
else callback(table.tostring(rtn),colour) end
|
else callback(table.tostring(rtn),use_colour) end
|
||||||
-- test for: function
|
-- test for: function
|
||||||
elseif ExpLib.is_type(rtn,'function') then callback('Cant Display Functions',colour)
|
elseif ExpLib.is_type(rtn,'function') then callback('Cant Display Functions',use_colour)
|
||||||
-- else just call tostring
|
-- else just call tostring
|
||||||
else callback(tostring(rtn),colour) end
|
else callback(tostring(rtn),use_colour) end
|
||||||
end
|
end
|
||||||
if player then
|
if player then
|
||||||
-- allows any valid player identifier to be used
|
-- allows any valid player identifier to be used
|
||||||
@@ -133,7 +133,7 @@ function ExpLib.player_return(rtn,colour,player)
|
|||||||
if not player then error('Invalid Player given to player_return',2) end
|
if not player then error('Invalid Player given to player_return',2) end
|
||||||
-- plays a nice sound that is different to normal message sound
|
-- plays a nice sound that is different to normal message sound
|
||||||
player.play_sound{path='utility/scenario_message'}
|
player.play_sound{path='utility/scenario_message'}
|
||||||
_return(player.print,rtn)
|
_return(player.print,rtn,colour)
|
||||||
else _return(rcon.print,rtn) end
|
else _return(rcon.print,rtn) end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ return function()
|
|||||||
local rtn = {}
|
local rtn = {}
|
||||||
local default = {}
|
local default = {}
|
||||||
for _,role_name in pairs(Role.order) do
|
for _,role_name in pairs(Role.order) do
|
||||||
local role = Role.get(role_name)
|
local role = Role.get(role_name,true)
|
||||||
if role.is_default then default = {role.colour,role.short_hand,role:get_players(true),role.not_reportable}
|
if role.is_default then default = {role.colour,role.short_hand,role:get_players(true),role.not_reportable}
|
||||||
else table.insert(rtn,{role.colour,role.short_hand,role:get_players(true),role.not_reportable}) end
|
else table.insert(rtn,{role.colour,role.short_hand,role:get_players(true),role.not_reportable}) end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user