Jump to content

shoBy

Members
  • Posts

    138
  • Joined

  • Last visited

Details

  • Gang
    DayZ

shoBy's Achievements

Poot-butt

Poot-butt (14/54)

0

Reputation

  1. shoBy

    1.3.5

    How can i get 1.3.5 version?
  2. shoBy

    How to?

    Can't you add mtaserver on that link you gave to me?
  3. Hello community! As in the title, I really want a windows default mta server...Can I have one, please? Thank you in advance!
  4. Can we talk on a teamspeak3 server or just on PM forum?
  5. Hellow community! Do you know, how to open my mta server withouth host, on my pc(router(wireless), withouth wire) I just have to test some things with a friend. Thank you in advance!
  6. shoBy

    HELP

    Hey guys! I need some help....You know, on this website is lua scripting in Post a new Topic...Is here a program that can I download it?
  7. You mean that the admins speaks on the global chat from t(local) /ag [message] ? EDIT: Sorry, 266 resources 1 failed...Sorry... Server: -- DISCLAIMER --[[ Any user of this resource is allowed to modify the code for personal use, and are not allowed to share their own version with people. Do not attempt to resell this resource as it is avaiblable for FREE. Anyone caught breaking the disclamer will find themselves in trouble with the law under the Copyright Act 2008. You may use / edit only for PERSONAL USE. This code is copyrighted to Christopher Graham Smith (Urangan, Queensland, AUS). ]] -- Settings - These settings will change the scripts functions and allow you to disable certain parts. settings = { ['enableTeamChat'] = true, ['adminTag'] = { ['enabled'] = true, ['ACL'] = { -- A bit more advanced. { 'Admin', '#00B7FF[Admin] ' }, { 'SuperModerator', '#F200FF[s.mod] ' }, { 'Moderator', '#A1FF9C[Mod] ' }, { 'Everyone', ' ' } } }, ['swearFilter'] = { ['enabled'] = true, ['swearCost'] = 0, ['swears'] = { -- Allows you to set the blocked swear words, syntax is ['WORD'] = 'REPLACEMENT' ['asshole'] = '*******', ['fuck'] = '****', ['slut'] = '****', ['bitch'] = '*****', ['cunt'] = '****', ['whore'] = '*****', ['pussy'] = '*****', ['fag'] = '***', ['perro'] = '*****', ['puta'] = '****', ['joder'] = '*****' } }, ['antiSpamFilter'] = { ['enabled'] = true, ['execeptionGroups'] = 'Admin', -- Groups which can spam, eg. 'Admin,SuperModerator,Moderator' ['chatTimeOut'] = 1.5 -- Set in seconds. }, ['freezeChat'] = { ['enabled'] = true, ['command'] = 'freezechat', -- Command to use when activating frozen chat. ['allowedGroups'] = 'Admin,SuperModerator', -- Groups which have access to this command. ['resetTime'] = 5 -- Time in minutes before it automatically resets. }, ['clearChat'] = { ['enabled'] = true, ['command'] = 'clearchat', ['allowedGroups'] = 'Admin,SuperModerator' } } -- Required variables spam = { } stopChat = false function chatbox(message, msgtype) if stopChat then cancelEvent() outputChatBox('#FF0000[FREEZECHAT] #FFFFFFAn admin has recently frozen chat.', source, 255, 255, 255, true) return end local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) local serial = getPlayerSerial(source) local r, g, b = getPlayerNametagColor(source) local text = message:gsub("%a", string.upper, 1) local check = 0 local spamCheck = false if settings['swearFilter']['enabled'] then for i, v in pairs(settings['swearFilter']['swears']) do while text:lower():find(i:lower(),1,true) do local start, end_ = text:lower():find(i:lower(),1,true) local found = text:sub(start,end_) text = text:gsub(found,v) if settings['swearFilter']['swearCost'] ~= 0 then takePlayerMoney(source, settings['swearFilter']['swearCost']) end end end end if msgtype == 0 then cancelEvent() if not settings['adminTag']['enabled'] and not spam[serial] then message = RGBToHex(r, g, b) .. name .. ':#FFFFFF ' .. text if 128 <= #message then outputChatBox('#FF0000Error: The message you entered is too big, please lower it!', source, 255, 255, 255, true) else outputChatBox(message, getRootElement(), 255, 255, 255, true) aclgroup = split(settings['antiSpamFilter']['execeptionGroups'], ', ') or settings['antiSpamFilter']['execeptionGroups'] for i, v in ipairs(aclgroup) do if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup(v)) then spamCheck = true end end if not spamCheck then if settings['antiSpamFilter']['enabled'] then spam[serial] = true setTimer(function() spam[serial] = false end, settings['antiSpamFilter']['chatTimeOut']*1000, 1) end end outputServerLog('CHAT: ' .. name .. ': ' .. text) end return end for _,v in ipairs(settings['adminTag']['ACL']) do if isObjectInACLGroup('user.' .. account, aclGetGroup(v[1])) and check == 0 and not spam[serial] then local message = v[2] .. RGBToHex(r, g, b) .. name .. ":#FFFFFF " .. text if 128 <= #message then outputChatBox('#FF0000Error: The message you entered is too big, please lower it!', source, 255, 255, 255, true) check = 1 else check = 1 outputChatBox(message, getRootElement(), 255, 255, 255, true) if settings['antiSpamFilter']['enabled'] then aclgroup = split(settings['antiSpamFilter']['execeptionGroups'], ', ') or settings['antiSpamFilter']['execeptionGroups'] for i, v in ipairs(aclgroup) do if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup(v)) then spamCheck = true end end if not spamCheck then spam[serial] = true check = 1 setTimer(function() spam[serial] = false end, settings['antiSpamFilter']['chatTimeOut']*1000, 1) end end outputServerLog('CHAT: '.. v[2] .. name .. ': ' .. text) end elseif spam[serial] and check == 0 then outputChatBox('#FF0000Error: Please wait '..settings['antiSpamFilter']['chatTimeOut']..' seconds before saying a message!', source, 255, 255, 255, true) check = 1 end end elseif msgtype == 1 and not settings['enableTeamChat'] then cancelEvent() end end addEventHandler("onPlayerChat", getRootElement(), chatbox) addEventHandler("onPlayerQuit", getRootElement(), function() local serial = getPlayerName(source) spam[serial] = false end ) -- Freeze chat addCommandHandler(settings['freezeChat']['command'], function(player) if not settings['freezeChat']['enabled'] then return end aclgroup = split(settings['freezeChat']['allowedGroups'], ', ') or settings['freezeChat']['allowedGroups'] for i, v in ipairs(aclgroup) do if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup(v)) then check = true end end if not check then return end if not stopChat then outputChatBox('#FF0000[FREEZECHAT] #FFFFFF'..getPlayerName(player)..' has frozen the chat!', getRootElement(), 255, 255, 255, true) stopChat = true frozenTimer = setTimer(function() stopChat = false end, (settings['freezeChat']['resetTime'] * 60000), 1) else outputChatBox('#FF0000[FREEZECHAT] #FFFFFF'..getPlayerName(player)..' has unfrozen the chat!', getRootElement(), 255, 255, 255, true) stopChat = false end end ) -- Clear chat addCommandHandler(settings['clearChat']['command'], function(player) if not settings['clearChat']['enabled'] then return end aclgroup = split(settings['clearChat']['allowedGroups'], ',') or settings['clearChat']['allowedGroups'] for i, v in ipairs(aclgroup) do if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup(v)) then check = true end end if not check then return end for i = 2, getElementData(player, 'chatLines') do outputChatBox(' ') end outputChatBox('#FF0000[CLEARCHAT]#FFFFFF '..getPlayerName(player)..' has cleared the chat', getRootElement(), 255, 255, 255, true) end ) function RGBToHex(red, green, blue, alpha) return string.format("#%.2X%.2X%.2X", red,green,blue) end function talkAsAdmin(thePlayer, theCommand, ...) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then local message = table.concat(" ", {...}) outputChatBox("#FF0000[Admin]"..getPlayerName(thePlayer)..":#FFFFFF"..message, root, 0, 0, 0, true) end end addCommandHandler("ag", talkAsAdmin, false)
  8. Oh Sorry, bad english ) It works on roleplay I think, there, the chat is only on t(local chat), but on dayz is local chat and global chat(press x), so I want to make it to appear [Admin] or your adminrank on the global chat (x)
  9. Guys, this script works, but isn't for dayz mod. Server.lua -- DISCLAIMER --[[ Any user of this resource is allowed to modify the code for personal use, and are not allowed to share their own version with people. Do not attempt to resell this resource as it is avaiblable for FREE. Anyone caught breaking the disclamer will find themselves in trouble with the law under the Copyright Act 2008. You may use / edit only for PERSONAL USE. This code is copyrighted to Christopher Graham Smith (Urangan, Queensland, AUS). ]] -- Settings - These settings will change the scripts functions and allow you to disable certain parts. settings = { ['enableTeamChat'] = true, ['adminTag'] = { ['enabled'] = true, ['ACL'] = { -- A bit more advanced. { 'Admin', '#00B7FF[Admin] ' }, { 'SuperModerator', '#F200FF[s.mod] ' }, { 'Moderator', '#A1FF9C[Mod] ' }, { 'Everyone', ' ' } } }, ['swearFilter'] = { ['enabled'] = true, ['swearCost'] = 0, ['swears'] = { -- Allows you to set the blocked swear words, syntax is ['WORD'] = 'REPLACEMENT' ['asshole'] = '*******', ['fuck'] = '****', ['slut'] = '****', ['bitch'] = '*****', ['cunt'] = '****', ['whore'] = '*****', ['pussy'] = '*****', ['fag'] = '***', ['perro'] = '*****', ['puta'] = '****', ['joder'] = '*****' } }, ['antiSpamFilter'] = { ['enabled'] = true, ['execeptionGroups'] = 'Admin', -- Groups which can spam, eg. 'Admin,SuperModerator,Moderator' ['chatTimeOut'] = 1.5 -- Set in seconds. }, ['freezeChat'] = { ['enabled'] = true, ['command'] = 'freezechat', -- Command to use when activating frozen chat. ['allowedGroups'] = 'Admin,SuperModerator', -- Groups which have access to this command. ['resetTime'] = 5 -- Time in minutes before it automatically resets. }, ['clearChat'] = { ['enabled'] = true, ['command'] = 'clearchat', ['allowedGroups'] = 'Admin,SuperModerator' } } -- Required variables spam = { } stopChat = false function chatbox(message, msgtype) if stopChat then cancelEvent() outputChatBox('#FF0000[FREEZECHAT] #FFFFFFAn admin has recently frozen chat.', source, 255, 255, 255, true) return end local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) local serial = getPlayerSerial(source) local r, g, b = getPlayerNametagColor(source) local text = message:gsub("%a", string.upper, 1) local check = 0 local spamCheck = false if settings['swearFilter']['enabled'] then for i, v in pairs(settings['swearFilter']['swears']) do while text:lower():find(i:lower(),1,true) do local start, end_ = text:lower():find(i:lower(),1,true) local found = text:sub(start,end_) text = text:gsub(found,v) if settings['swearFilter']['swearCost'] ~= 0 then takePlayerMoney(source, settings['swearFilter']['swearCost']) end end end end if msgtype == 0 then cancelEvent() if not settings['adminTag']['enabled'] and not spam[serial] then message = RGBToHex(r, g, b) .. name .. ':#FFFFFF ' .. text if 128 <= #message then outputChatBox('#FF0000Error: The message you entered is too big, please lower it!', source, 255, 255, 255, true) else outputChatBox(message, getRootElement(), 255, 255, 255, true) aclgroup = split(settings['antiSpamFilter']['execeptionGroups'], ', ') or settings['antiSpamFilter']['execeptionGroups'] for i, v in ipairs(aclgroup) do if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup(v)) then spamCheck = true end end if not spamCheck then if settings['antiSpamFilter']['enabled'] then spam[serial] = true setTimer(function() spam[serial] = false end, settings['antiSpamFilter']['chatTimeOut']*1000, 1) end end outputServerLog('CHAT: ' .. name .. ': ' .. text) end return end for _,v in ipairs(settings['adminTag']['ACL']) do if isObjectInACLGroup('user.' .. account, aclGetGroup(v[1])) and check == 0 and not spam[serial] then local message = v[2] .. RGBToHex(r, g, b) .. name .. ":#FFFFFF " .. text if 128 <= #message then outputChatBox('#FF0000Error: The message you entered is too big, please lower it!', source, 255, 255, 255, true) check = 1 else check = 1 outputChatBox(message, getRootElement(), 255, 255, 255, true) if settings['antiSpamFilter']['enabled'] then aclgroup = split(settings['antiSpamFilter']['execeptionGroups'], ', ') or settings['antiSpamFilter']['execeptionGroups'] for i, v in ipairs(aclgroup) do if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup(v)) then spamCheck = true end end if not spamCheck then spam[serial] = true check = 1 setTimer(function() spam[serial] = false end, settings['antiSpamFilter']['chatTimeOut']*1000, 1) end end outputServerLog('CHAT: '.. v[2] .. name .. ': ' .. text) end elseif spam[serial] and check == 0 then outputChatBox('#FF0000Error: Please wait '..settings['antiSpamFilter']['chatTimeOut']..' seconds before saying a message!', source, 255, 255, 255, true) check = 1 end end elseif msgtype == 1 and not settings['enableTeamChat'] then cancelEvent() end end addEventHandler("onPlayerChat", getRootElement(), chatbox) addEventHandler("onPlayerQuit", getRootElement(), function() local serial = getPlayerName(source) spam[serial] = false end ) -- Freeze chat addCommandHandler(settings['freezeChat']['command'], function(player) if not settings['freezeChat']['enabled'] then return end aclgroup = split(settings['freezeChat']['allowedGroups'], ', ') or settings['freezeChat']['allowedGroups'] for i, v in ipairs(aclgroup) do if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup(v)) then check = true end end if not check then return end if not stopChat then outputChatBox('#FF0000[FREEZECHAT] #FFFFFF'..getPlayerName(player)..' has frozen the chat!', getRootElement(), 255, 255, 255, true) stopChat = true frozenTimer = setTimer(function() stopChat = false end, (settings['freezeChat']['resetTime'] * 60000), 1) else outputChatBox('#FF0000[FREEZECHAT] #FFFFFF'..getPlayerName(player)..' has unfrozen the chat!', getRootElement(), 255, 255, 255, true) stopChat = false end end ) -- Clear chat addCommandHandler(settings['clearChat']['command'], function(player) if not settings['clearChat']['enabled'] then return end aclgroup = split(settings['clearChat']['allowedGroups'], ',') or settings['clearChat']['allowedGroups'] for i, v in ipairs(aclgroup) do if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup(v)) then check = true end end if not check then return end for i = 2, getElementData(player, 'chatLines') do outputChatBox(' ') end outputChatBox('#FF0000[CLEARCHAT]#FFFFFF '..getPlayerName(player)..' has cleared the chat', getRootElement(), 255, 255, 255, true) end ) function RGBToHex(red, green, blue, alpha) return string.format("#%.2X%.2X%.2X", red,green,blue) end Client.lua -- Set chatbox layout data. chatLines = getChatboxLayout()["chat_lines"] setElementData(localPlayer, 'chatLines', chatLines) So, I tryed to create this script: addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); But it isn't working for that script. Can you say to me which is the problem, please ?
  10. Sorry, I saw now. I'll edit it.
  11. Guys, I don't know if this script is good: -- Global chat function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then else -- then if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP) else -- then outputChatBox("#FF0000[Owner]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) else -- then outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); end ) function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Co-Owner")) then else -- then if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP) else -- then outputChatBox("#FF0000[Co-Owner]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) else -- then outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); end ) function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Trial")) then else -- then if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP) else -- then outputChatBox("#FF0000[Trial Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) else -- then outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); end ) function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 5")) then else -- then if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP) else -- then outputChatBox("#FF0000[super Mod]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) else -- then outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); end ) function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Owner")) then else -- then if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP) else -- then outputChatBox("#FF0000[Admin]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) else -- then outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); end ) function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 1")) then else -- then if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP) else -- then outputChatBox("#FF0000[Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) else -- then outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); end ) function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then else -- then if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP) else -- then outputChatBox("#FF0000[Moderator]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) else -- then outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); end ) function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 2")) then else if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP) else -- then outputChatBox("#FF0000[super Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) else -- then outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); end ) function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 4")) then else -- then if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP) else -- then outputChatBox("#FF0000[Mod]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) else -- then outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); end ) function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if
  12. Yah, sure, thank you. If I can't...
  13. The script looks like this one in the folder: Map: - baseb2_s: RestricLocation = {} TeleportLocation = {} EnabledAlarm = true TimesToKick = {} TimeSireneEnabled = true ColCuboid = false --------------------------------------- CONFIGS -------------------------------------------- RestricLocation["location1"] = {869.90002441406,-1996.9000244141,37.299999237061} --Local PARTE DE CIMA RestricLocation["location2"] = {811.29998779297,-2076.8999023438,-9.6999998092651} --LOCAL PARTE DE BAIXO TeleportLocation = {836.59997558594,-1977.8000488281,12.39999961853} --LOCAL TO TELEPORT PLAYER GroupName = "Staff" -- name of the acl/gang group !!! GroupNameBy = 1 -- 1 for gang name, 2 for ACL group ! cmdTurnON = "turnONcmd" -- Command to enable alarm / cmdTurnOFF = "TurnOFFcmd" -- Command to disable alarm / MsgtoKICK = "Area protected! Leave or kick!" MsgCantCreateCollision = "Can't be created the Collision, check your location1 and location2" EnableVehicleGodMode = true -- true enabled, false disabled. KickORBAN = 1 -- 1 for kick player, 2 for BAN BanTime = 900000 -- time in seconds of ban, 900000 sec = 15 min MsgBAN = "Invasor" -- Reason of BAN ! --------------------------------------- CONFIGS -------------------------------------------- function sendMsg(iplayer,msg) outputChatBox ( msg, iplayer, 255, 255, 255, true ) end function EnterPlace ( theElement ) if (getElementType ( theElement ) == "player") and (PlayerHaveLevel (theElement) == false) and (EnabledAlarm == true ) then if(TimesToKick[theElement] > 0) then sendMsg(theElement,MsgtoKICK ..TimesToKick[theElement]) TimesToKick[theElement] = TimesToKick[theElement] -1 setElementPosition( theElement, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) if TimeSireneEnabled == true then triggerClientEvent ( "ActiveAlarm", getRootElement() ) end sendMsgOwners(theElement) else if (KickORBAN == 1) then kickPlayer(theElement) else banPlayer ( theElement , false, false, true, "Alarme system Base", MsgBAN, BanTime ) end end elseif getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,true) end end function ExitPlace ( theElement ) if getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,false) end end function ASBenable1 ( source ) if(PlayerHaveLevel (source) == true) then EnabledAlarm = true end end function ASBdisable1 ( source ) if(PlayerHaveLevel (source) == true) then EnabledAlarm = false end end function ResetStats ( ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if TimesToKick[aPlayer] == nil then TimesToKick[aPlayer] = 5 end if(TimesToKick[aPlayer] < 5) then TimesToKick[aPlayer] = TimesToKick[aPlayer] + 1 end end end function playerConnect ( playerNick ) local iPlayer = getPlayerFromName ( playerNick ) TimesToKick[iPlayer] = 5 end function PlayerHaveLevel( PlayerID ) if GroupNameBy == 1 then if ( getElementData ( PlayerID , "gang" ) == GroupName ) then return true else return false end else local accName = getAccountName ( getPlayerAccount ( PlayerID ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName ) ) ) then return true else return false end end end function ResourceStart( ) LoadLocations() CreateCollision() local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do TimesToKick[aPlayer] = 5 end end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ),ResourceStart) function LoadLocations() local RX, RY, RZ, WRX, WRX, WRX if(RestricLocation["location1"][1] > RestricLocation["location2"][1]) then RestricLocation["maxx"] = RestricLocation["location1"][1] RestricLocation["minx"] = RestricLocation["location2"][1] else RestricLocation["maxx"] = RestricLocation["location2"][1] RestricLocation["minx"] = RestricLocation["location1"][1] end if(RestricLocation["location1"][2] > RestricLocation["location2"][2]) then RestricLocation["maxy"] = RestricLocation["location1"][2] RestricLocation["miny"] = RestricLocation["location2"][2] else RestricLocation["maxy"] = RestricLocation["location2"][2] RestricLocation["miny"] = RestricLocation["location1"][2] end if(RestricLocation["location1"][3] > RestricLocation["location2"][3]) then RestricLocation["maxz"] = RestricLocation["location1"][3] RestricLocation["minz"] = RestricLocation["location2"][3] else RestricLocation["maxz"] = RestricLocation["location2"][3] RestricLocation["minz"] = RestricLocation["location1"][3] end end function CreateCollision() RX = RestricLocation["minx"] WRX = RestricLocation["maxx"] - RestricLocation["minx"] RY = RestricLocation["miny"] WRY = RestricLocation["maxy"] - RestricLocation["miny"] RZ = RestricLocation["minz"] WRZ = RestricLocation["maxz"] - RestricLocation["minz"] ColCuboid = createColCuboid ( RX, RY, RZ, WRX, WRY, WRZ ) if ColCuboid then addEventHandler ( "onColShapeHit", ColCuboid, EnterPlace ) addEventHandler ( "onColShapeLeave", ColCuboid, ExitPlace ) else outputDebugString(MsgCantCreateCollision) end end function ResourceStop( ) destroyElement ( ColCuboid ) end addEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ),ResourceStop) function SireneEnabled() TimeSireneEnabled = true end function sendMsgOwners( PlayerID ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if(PlayerHaveLevel (aPlayer) == true) then sendMsg(aPlayer," Player " ..getPlayerName ( PlayerID ) .." is trying to join in our base!") end end end function SetVehicleGodMode( VehicleID, godEoD ) if EnableVehicleGodMode == true then setElementData(VehicleID, "godmode", godEoD) setVehicleDamageProof (VehicleID, godEoD ) end end setTimer ( SireneEnabled , 20000, 0, "" ) setTimer ( ResetStats , 15000, 0, "" ) addCommandHandler("alarmon",ASBenable1) addCommandHandler("alarmoff",ASBdisable1) addEventHandler ("onPlayerConnect", getRootElement(), playerConnect) *To change locations, use map editor -> create a gate -> double click (x,y,z) gatescript: function createTheGate () myGate1 = createObject ( 980,664.90002441406,-1309.0999755859,15.199999809265, 0, 0, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function openMyGate ( ) moveObject ( myGate1, 2500,664.90002441406,-1309.0999755859,15.199999809265) end addCommandHandler("s3",openMyGate) function movingMyGateBack () moveObject ( myGate1, 2500,652.90002441406,-1309.3000488281,15.199999809265) end addCommandHandler("s4",movingMyGateBack) *Command to open the gate is s4 and to lose s3. If you want more gates, just use myGate2, like this one: myGate2 = createObject ( 980,786.09997558594,-1152.5,25.200000762939, 0, 0, 90 ) function openMyGate ( ) moveObject ( myGate2, 2500, 786.09997558594,-1152.5,25.200000762939) end addCommandHandler("s1",openMyGate) function movingMyGateBack () moveObject ( myGate2, 2500, 786.20001220703, -1164, 25.200000762939) end addCommandHandler("s2",movingMyGateBack) *Command to open/close s2/s1. The meta.xml, looks like this one: <meta> <info author="shoBy" version="1.0" name="Base" type="misc" /> <info type="map" version="1.0.0"></info> <map src="(yourmapname).map" dimension="0"></map> <script src="gatescript.lua" type="server" /> <script src="gatescript2.lua" type="server" /> <script src="(yourbasename(lua)).lua" type="server" /> </meta> Good luck! EDIT!!: You said: Thank you dude, but i need system where bases can buy by game $. To make a system like this, you can use the script of the gate, a map from map editor made by you or by other and a house system like this one: viewtopic.php?f=108&t=27571 Good luck, again!
  14. I don't know, sorry, I can't do it. Can you help me putting it on the script, please ?
×
×
  • Create New...