-
Posts
2,753 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Captain Cody
-
And here's an update for this code. local aSavePlaces = { Circle = { -- x, y, radius }, Cuboid = { -- x, y, z, Width, Depth, Height }, Rectangle = { -- X, Y, Width, Height { 108.46, -1977.84, 85, 58 }, -- Hospitals + Spawn Base { 1994.38, -1453.32, 110, 75 }, { 1155.28, -1350.23, 65, 58 }, { 1234.93, 302.44, 40, 58 }, { 191.56, -83.96, 40, 58 }, { 1589.75, 1800.18, 40, 58 }, { -339.67, 1029.49, 40, 58 }, { -1536.27, 2504.90, 40, 58 }, { -2681.42, 582.40, 40, 58 }, { -2224, -2326.97, 40, 58 }, { 1560, -1137.41, 165, 158 }, -- Boss { 2372.29, 1823.58, 135, 158 }, { -2145.80, 118.67, 158, 200 }, { 436.91, 767.93, 450, 280 }, -- Trabajos { -413.28, -1570.95, 270, 328 }, }, Sphere = { -- X, Y, Z, Radius }, Tube = { -- X, Y, Z, Radius, Height }, Polygon = { -- X, Y, X1, Y1, X2, Y2, X3, Y3, ... -- You can add like X4, Y4 .. } } local aRadarAreaPlaces = { { 108.46, -1977.84, 85, 58, 0, 255, 0, 0 }, -- Hospitals + Spawn Base { 1994.38, -1453.32, 110, 75, 0, 255, 0, 0 }, { 1155.28, -1350.23, 65, 58, 0, 255, 0, 0 }, { 1234.93, 302.44, 40, 58, 0, 255, 0, 0 }, { 191.56, -83.96, 40, 58, 0, 255, 0, 0 }, { 1589.75, 1800.18, 40, 58, 0, 255, 0, 0 }, { -339.67, 1029.49, 40, 58, 0, 255, 0, 0 }, { -1536.27, 2504.90, 40, 58, 0, 255, 0, 0 }, { -2681.42, 582.40, 40, 58, 0, 255, 0, 0 }, { -2224, -2326.97, 40, 58, 0, 255, 0, 0 }, { 1560, -1137.41, 165, 158, 0, 255, 0, 0 }, -- Boss { 2372.29, 1823.58, 135, 158, 0, 255, 0, 0 }, { -2145.80, 118.67, 158, 200, 0, 255, 0, 0 }, { 436.91, 767.93, 450, 280, 0, 255, 0, 0 }, -- Trabajos { -413.28, -1570.95, 270, 328, 0, 255, 0, 0 }, } local sResourceName = getResourceName ( resource ) local bUseGunsInSavePlace = get( sResourceName .. '.UseGunsInSaveZone' ) local bUseRadarArea = get( sResourceName .. '.UseRadarArea' ) local pColshape, pRadarArea local bUseRunInSaveZone = get( sResourceName .. '.UseRunInSaveZone' ) local bUseJumpInSaveZone = get( sResourceName .. '.UseJumpInSaveZone' ) local bUseWeaponHudInSaveZone = get( sResourceName .. '.UseWeaponHudInSaveZone' ) local bUseAmmoHudInSaveZone = get( sResourceName .. '.UseAmmoHudInSaveZone' ) local bUseDamageInSaveZone = get( sResourceName .. '.UseDamageInSaveZone' ) addEventHandler ( 'onResourceStart', resourceRoot, function ( ) local display = textCreateDisplay () local text = textCreateTextItem("Estas en Zona Segura !", 0.9, 0.7, "high", 0, 255, 0, 255, 2, "right", "bottom") textDisplayAddText(display, text) for s, _ in pairs( aSavePlaces ) do for _, a in pairs( aSavePlaces[ s ] ) do pColshape = _G[ 'createCol' .. s ]( unpack( a ) ) --setElementData( pColshape, 'zombieProof', true ) addEventHandler ( 'onColShapeHit', pColshape, function ( pHitElement ) if getElementType( pHitElement ) == 'player' then textDisplayAddObserver(display, pHitElement) if not bUseGunsInSavePlace then end if not bUseDamageInSaveZone then setElementData( pHitElement, 'damage', 'no' ) end elseif getElementType( pHitElement ) == 'ped' then -- check if the entered ped kill it if getElementData(pHitElement, "zombie") then if not getElementData(pHitElement,"boss") then killPed(pHitElement) end end end ) addEventHandler ( 'onColShapeLeave', pColshape, function ( pLeaveElement ) if getElementType( pLeaveElement ) == 'player' then textDisplayRemoveObserver(display, pLeaveElement) if not bUseGunsInSavePlace then end if not bUseDamageInSaveZone then setElementData( pLeaveElement, 'damage', 'yes' ) end elseif getElementType( pLeaveElement ) == 'ped' then -- check if the entered ped kill it end end ) end end if bUseRadarArea then for _, a in ipairs( aRadarAreaPlaces ) do pRadarArea = createRadarArea ( unpack( a ) ) setElementData( pRadarArea, 'zombieProof', true ) end end end )
-
I gave you a working code. But you removed the changes I put. local aSavePlaces = { Circle = { -- x, y, radius }, Cuboid = { -- x, y, z, Width, Depth, Height }, Rectangle = { -- X, Y, Width, Height { 108.46, -1977.84, 85, 58 }, -- Hospitals + Spawn Base { 1994.38, -1453.32, 110, 75 }, { 1155.28, -1350.23, 65, 58 }, { 1234.93, 302.44, 40, 58 }, { 191.56, -83.96, 40, 58 }, { 1589.75, 1800.18, 40, 58 }, { -339.67, 1029.49, 40, 58 }, { -1536.27, 2504.90, 40, 58 }, { -2681.42, 582.40, 40, 58 }, { -2224, -2326.97, 40, 58 }, { 1560, -1137.41, 165, 158 }, -- Boss { 2372.29, 1823.58, 135, 158 }, { -2145.80, 118.67, 158, 200 }, { 436.91, 767.93, 450, 280 }, -- Trabajos { -413.28, -1570.95, 270, 328 }, }, Sphere = { -- X, Y, Z, Radius }, Tube = { -- X, Y, Z, Radius, Height }, Polygon = { -- X, Y, X1, Y1, X2, Y2, X3, Y3, ... -- You can add like X4, Y4 .. } } local aRadarAreaPlaces = { { 108.46, -1977.84, 85, 58, 0, 255, 0, 0 }, -- Hospitals + Spawn Base { 1994.38, -1453.32, 110, 75, 0, 255, 0, 0 }, { 1155.28, -1350.23, 65, 58, 0, 255, 0, 0 }, { 1234.93, 302.44, 40, 58, 0, 255, 0, 0 }, { 191.56, -83.96, 40, 58, 0, 255, 0, 0 }, { 1589.75, 1800.18, 40, 58, 0, 255, 0, 0 }, { -339.67, 1029.49, 40, 58, 0, 255, 0, 0 }, { -1536.27, 2504.90, 40, 58, 0, 255, 0, 0 }, { -2681.42, 582.40, 40, 58, 0, 255, 0, 0 }, { -2224, -2326.97, 40, 58, 0, 255, 0, 0 }, { 1560, -1137.41, 165, 158, 0, 255, 0, 0 }, -- Boss { 2372.29, 1823.58, 135, 158, 0, 255, 0, 0 }, { -2145.80, 118.67, 158, 200, 0, 255, 0, 0 }, { 436.91, 767.93, 450, 280, 0, 255, 0, 0 }, -- Trabajos { -413.28, -1570.95, 270, 328, 0, 255, 0, 0 }, } local sResourceName = getResourceName ( resource ) local bUseGunsInSavePlace = get( sResourceName .. '.UseGunsInSaveZone' ) local bUseRadarArea = get( sResourceName .. '.UseRadarArea' ) local pColshape, pRadarArea local bUseRunInSaveZone = get( sResourceName .. '.UseRunInSaveZone' ) local bUseJumpInSaveZone = get( sResourceName .. '.UseJumpInSaveZone' ) local bUseWeaponHudInSaveZone = get( sResourceName .. '.UseWeaponHudInSaveZone' ) local bUseAmmoHudInSaveZone = get( sResourceName .. '.UseAmmoHudInSaveZone' ) local bUseDamageInSaveZone = get( sResourceName .. '.UseDamageInSaveZone' ) addEventHandler ( 'onResourceStart', resourceRoot, function ( ) local display = textCreateDisplay () local text = textCreateTextItem("Estas en Zona Segura !", 0.9, 0.7, "high", 0, 255, 0, 255, 2, "right", "bottom") textDisplayAddText(display, text) for s, _ in pairs( aSavePlaces ) do for _, a in pairs( aSavePlaces[ s ] ) do pColshape = _G[ 'createCol' .. s ]( unpack( a ) ) --setElementData( pColshape, 'zombieProof', true ) addEventHandler ( 'onColShapeHit', pColshape, function ( pHitElement ) if getElementType( pHitElement ) == 'player' then if not getElementData(pHitElement,"boss") then textDisplayAddObserver(display, pHitElement) if not bUseGunsInSavePlace then end if not bUseDamageInSaveZone then setElementData( pHitElement, 'damage', 'no' ) end end elseif getElementType( pHitElement ) == 'ped' then -- check if the entered ped kill it if getElementData(pHitElement, "zombie") then killPed(pHitElement) end end end ) addEventHandler ( 'onColShapeLeave', pColshape, function ( pLeaveElement ) if getElementType( pLeaveElement ) == 'player' then textDisplayRemoveObserver(display, pLeaveElement) if not bUseGunsInSavePlace then end if not bUseDamageInSaveZone then setElementData( pLeaveElement, 'damage', 'yes' ) end elseif getElementType( pLeaveElement ) == 'ped' then -- check if the entered ped kill it end end ) end end if bUseRadarArea then for _, a in ipairs( aRadarAreaPlaces ) do pRadarArea = createRadarArea ( unpack( a ) ) setElementData( pRadarArea, 'zombieProof', true ) end end end ) setElementData(BossElement,"boss",true) -- To assign a boss.
-
https://wiki.multitheftauto.com/wiki/String.split
-
Please use imgur or something similar to upload picture, cannot see this one.
-
https://wiki.multitheftauto.com/wiki/TriggerClientEvent
-
addEventHandler ("onClientGUIClick", vehicleTab, tabVehicles, false) This is using theStaticImage to trigger a menu.. function clickVehicleTab () vehicleTab = guiCreateStaticImage(0.825, 0.6122, 0.14, 0.07 "images/EmptyButton.png", gFactionWindow) addEventHandler ("onClientGUIClick", vehicleTab, openVehicleTab, false) end function openVehicleTab(button, state) if (button=="left") and (state=="up") and (source==vehicleTab) then tabVehicles = guiCreateWindow(0, 0.04, 1, 1, "Vehicles", true) end end Going to assume that's what you were trying to do. Any other problems, I'd need the whole script. Gets annoying when people just post partial scripts not giving an other back round info.
-
Oh I already know of that. Xwads that one that needs it.
-
That's what I said originally but I was questioning whether or not it would work (Have never used bone attach)
-
You need to make it trigger for everyone.
-
Or another thing for i,v in pairs(getElementByID("marker")) do local blip = createBlipAttachedTo(v, 41) end Exactly what you asked for in the first post.
-
local hostname = "127.0.0.1" local database = "air_forum_server_db" local username = "root" local password = "********" local mysql = dbConnect("mysql", "dbname="..database..";host="..hostname, username, password) if mysql then outputDebugString("MySQL has been successfuly connected!",3, 255, 255, 255, true) end local query = dbQuery(mysql,"SELECT * FROM `air_forum_server_db_tablemembers` WHERE 1") local poll = dbPoll(query,-1) function log(source,command,username,password) for k,v in ipairs(poll) do if username == (v.member_name) and (hash("sha1",username..password) == v.passwd) then outputChatBox("You Sucessfully logined in ",source,255,255,255,true) --else --outputChatBox("Wrong username/password",source,255,255,255,true) end end end addCommandHandler("log",log) And, make sure the passwords and what not are all right, what this does here is just disable the output for wrong user / pass.
-
--============================================================================================================================ function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(thePlayer) --============================================================================================================================ -- Mute if isPlayerMuted ( thePlayer ) then outputChatBox ("You are muted!", thePlayer, 255, 128, 22, true) return end --============================================================================================================================ -- Chat - Prefix outputChatBox("#FFFFFF[#FF0000Survivor#FFFFFF] #0000FF"..name..": #DEFF00"..message, getRootElement(), 255, 255, 255, true) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(playersource)), aclGetGroup("Admin")) then outputChatBox("[#4F4F4FMTA#FF0000DayZ#FFFFFF][#FF0000ADMINISTRATOR] #FF6B00" .. getPlayerName(playersource) .. ": #F3FF00" .. msg, getRootElement(), 60, 200, 40, true) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(playersource)), aclGetGroup("Console")) then outputChatBox("#FFFFFF[#4F4F4FMTA#FF0000DayZ#FFFFFF][#FF0000O Server Owner#FFFFFF] #0000ff" .. getPlayerName(playersource) .. ": #F3FF00" .. msg, getRootElement(), 60, 200, 40, true) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(playersource)), aclGetGroup("Dev")) then outputChatBox("#FFFFFF[#4F4F4FMTA#FF0000DayZ#FFFFFF][#FF0000 Server Developer#FFFFFF] #0000ff" .. getPlayerName(playersource) .. ": #F3FF00" .. msg, getRootElement(), 60, 200, 40, true) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(playersource)), aclGetGroup("VIP")) then outputChatBox("#FFFFFF[#4F4F4FMTA#FF0000DayZ#FFFFFF][#7a7666VIP PLAYER#FFFFFF] #009b76" .. getPlayerName(playersource) .. ": #F3FF00" .. msg, getRootElement(), 60, 200, 40, true) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(playersource)), aclGetGroup("Moderator")) then outputChatBox("#FFFFFF[#4F4F4FMTA#FF0000DayZ#FFFFFF][#686c5eMODERATOR#FFFFFF] #4b0082" .. getPlayerName(playersource) .. ": #F3FF00" .. msg, getRootElement(), 60, 200, 40, true) --============================================================================================================================ -- Log Console outputServerLog("[CHAT]"..getPlayerName(thePlayer)..": "..message) --============================================================================================================================ end end addCommandHandler("GlobalChat", globalMessage)
-
local time = {56333,3292,2123} ---<<-- Make sure to have numbers above 50 local random = math.random(0,#time) timer = setTimer(function() --stuff here-- end, time[random], 0) Oh yeh sorry forgot, make sure that the numbers are all above 50. If you wanted to use math.random to make the number -> local number = math.random(50,5000) -- Chooses a number in-between 50 and 5000
-
local time = {1,2,3,4,45,56333,3} local random = math.random(0,#time) timer = setTimer(function() --stuff here-- end, time[random], 0) And yes, I didn't notice that extra end.
-
Seams to be nothing wrong with the code. Are you sure you copied Client side correctly?
-
time = math.random(1000,5000) timer = setTimer(function() --stuff here-- end end, time, 0)
-
Try my script again, type /debugscript 3, then take a screen shot so I can find the source of the issue.
-
That sets up the table. Table = {} -- Creates an empty table Table[1] = "Test" -- Assigns a value to the table function test () local tablea = Table[2] -- Turns value #2 into a local table local tablea[1] = "test" -- Assigns a value to the table local tableb = tablea[1] -- Deeper table. --- And so on
-
Teamsb = {} Teams = { "Military", "FIB", "SWAT" } for i,v in pairs (Teams) do Teamsb[v] = getTeamFromName[v] end This what you looking for?
-
Or you can use this teama = teams[1] --- Switch out 1 with the number you want as long as its in range in the table. But after looking at what you want, other guys solution would work better I believe.
-
exports.CISvip:removePlayerVIP(accountName,tonumber(amount)) exports.CISaccounts:GPM(player, cash, "converted "..amount.." VIP Changing the T to an S won't convince any practical scripter not encouraging this what so ever but if you at least going to try to post a leaked script, at-least make it convincing. Another thing is, If you know how to create the exports and what not, you'd be able to do something such as this on your own.
-
You could probably store it in play account data, if you have satchels, but you buy a grandade you can run a check if you have sctchles store the amount you have then give you a grande. But you would have to have a command or key bound to switch between those to.
-
He was messaging me on Skype about this, said there was nothing in debug.
-
or or or or -- blips = {} function Blip () for id, player in ipairs(getElementsByType("player")) do local r, g, b = getTeamColor(getPlayerTeam(player)) if blips[player] then setBlipColor (blips[player],r, g, b,255) else blips[player] = createBlipAttachedTo(player, 0, 2, r, g, b) end end end setTimer(Blip, 5000, 0) function quit () destroyElement(blips[source]) end addEventHandler("onPlayerQuit", getRootElement(), quit) function dead (totalammo, killer, killerweapon) destroyElement(blips[source]) end addEventHandler("onPlayerWasted", getRootElement(), dead) Updates the color every 5. I forgot to change PLAYERS to player. Small mistake, rest of the code should work perfectly from what I know.
