Jump to content

Bean666

Members
  • Posts

    732
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Bean666

  1. Do u want a real time or IN-Game time?
  2. local removedIDs = { 33, 4, 28, 21, 22, 23, 6, 7, 8, 29, 30, 17, 18, 26, 27, 52, 53, 5, 0, 1, 2, 12, 14, 15, 16, 11 } setWorldSoundEnabled ( 5, true) for i, sound in pairs(removedIDs) do setWorldSoundEnabled(5, sound, false) end All gunsounds / reload sounds are disabled here except for M4 / AK, just remove the other ids if u want, im not sure what id the reload sound there is but yeah you'll find out if you try and edit it yourself.
  3. No idea what you're trying to do with function 2 but i fixed the check. if the check's your only problem then this should fix it. local Grupo = { ["Policial"] = true -- You can add more groups here if you want. } function isPlayerOnGroup2 ( thePlayer ) local account = getPlayerAccount ( thePlayer ) for group, bool in pairs(Grupo) do if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(group)) then return true end return false end end function ClickJogdor ( Player ) if isPlayerOnGroup2 ( source ) then local account = getPlayerAccount (Player) if isGuestAccount (account) then msgFeniX(source, "Esse Jogador está deslogado !", "error") return end local cx, cy, cz = getElementPosition ( Player ) local px, py, pz = getElementPosition ( source ) local distance = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if ( distance <= 1.7 ) then -- if Player == source then return end triggerClientEvent (source , "FeniX_AbrirDX" , source) setElementData(source, "FeniXMTA_Suspeito" , Player) end end end addEvent ( "FeniX_ClickJogdor", true ) addEventHandler ( "FeniX_ClickJogdor", root, ClickJogdor)
  4. hahah i have the same vehicle damage property, why were they not gaining the same damage they are the same model. and no it doesn't trigger on vehicle explosion, the first SWAT tank only got 1 trigger on the rocket explosion, the second one got 2 triggers on the rocket explosion itself. anyways i think this is a bug, suddenly i restarted server and everything's fine now, thanks!
  5. Hi i noticed something different, When i create a vehicle via script the damage event doesn't work, but when i create by admin panel it does Black vehicle is created serverside, are vehicles in admin panel created client side? idk man here: also the damage function on vehicle works properly, but its just with the vehicles created from script serverside as u can see on the video. damage event is onClientVehicleDamage btw. also you can see the outputChatBox debug there, when i shot the vehicle created by admin panel the "boom" message only popped up once, even with the RPG, but when i shot the vehicle created by a server-side script, the boom shows up twice on the explosion thus triggering the damage event twice as well. why? They shouldn't be any different right? I mean, they're the same vehicle model and all so what's the thing that's messing with it? I only have 1 vehicle damaging script as well. and if there would have to be something messing with it, why is it not triggering twice on the vehicle made by the panel? Damage Part on the onClientVehicleDamage if weapon ~= 37 and warMachines[model] then if attacker and attacker == localPlayer then outputChatBox("boom!") triggerServerEvent ("damageWarMachine", source, source, attacker, weapon, bodypart ) cancelEvent() end end creation of the vehicle server: APC1 = createVehicle( 601, 447.017578125, 725.5615234375, 6.7242736816406, 0, 0, 246.6 ) setVehicleColor(APC1, 45, 45, 45, 45, 45, 45)
  6. Try adding a check so it doesn't repeat itself local DXShowing = false function Imagen_al_morir() if DXShowing == false then DXShowing = true addEventHandler("onClientRender", root, MuerteSistema) end tempo = 30 setElementData(localPlayer,'tiempo_de_respawn',tempo) setTimer (function() tempo = tempo-1 setElementData(localPlayer,'tiempo_de_respawn',tempo) end,1000,30) setTimer (function() DXShowing = false removeEventHandler("onClientRender", root, MuerteSistema) end,1000*30,1) end
  7. I have no idea what you're trying to do but i can see that your problem is "creating new team names in scoreboard right?" i'm assuming that's because of the amount of loops you have anyway try this: function Scoreboard.playersShow() scoreboard = {} local arenaElement = getElementParent(localPlayer) if getElementData(localPlayer,"mode") == "Competitive" then for i,player in pairs(exports["CCS"]:export_getPlayersAndSpectatorsInArena(arenaElement)) do table.insert(scoreboard,{"player",player}) end return end for i,player in pairs(exports["CCS"]:export_getPlayersAndSpectatorsInArena(arenaElement)) do if not getPlayerTeam(player) then table.insert(scoreboard,{"player",player}) end end local team = getElementsByType("team") local teamCount = countPlayersInTeam ( team ) if teamCount >= 1 then local teams = getTeamFromName ( tostring(team) ) if not teams then table.insert(scoreboard,{"teamName",team}) end for v,playerTeam in ipairs (getPlayersInTeam(team)) do if getElementParent(playerTeam) == arenaElement then table.insert(scoreboard,{"player",playerTeam}) end end end end and tell me what doesn't work, if this doesn't work, explain your problem properly, and make sure to check /debugscript 3 if there are any errors. also i'm confused on what you're trying to do with this: for v,playerTeam in ipairs (getPlayersInTeam(team)) do if getElementParent(playerTeam) == arenaElement then table.insert(scoreboard,{"player",playerTeam}) end end
  8. SOLVED. onClientPlayerWeaponFire + hitElement arg worked.
  9. Hello , i've been trying to make rhino be damaged by RPGs or explosions and such, but it's hard to do it. 'on ID S.W.A.T tank explosions work, they do the damage, but for the rhino idk why it doesn't. I didn't restrict any Weapon IDs for now to check if it really works. but still explosions do not work on rhino despite the event. local armoredVehicles = { [432] = true, [601] = true } function warMachineDamage(attacker, weapon, loss, x, y, z, tire) local model = getElementModel(source) if weapon and armoredVehicles[model] then cancelEvent() triggerServerEvent ("damageWarMachine", source, source, attacker, weapon, bodypart ) end end addEventHandler("onClientVehicleDamage", root, warMachineDamage) Server: addEvent( "damageWarMachine", true ) function damageWarMachine( vehicle, attacker, weapon, bodypart) local vehicleHealth = getElementHealth(vehicle) setElementHealth(vehicle, vehicleHealth - 500 ) end addEventHandler( "damageWarMachine", root, damageWarMachine ) Does anyone know a workaround this? Like maybe use onClientExplosion? and maybe onClientPlayerWeaponFire then define the weapon and the hitElement then trigger the event?
  10. indeed, it's working fine now too, it seldomly happens. idk why, but now it's all good, i'll update if it ever happens again, might've been just an error. thanks!
  11. yes. i tried on a vanilla weapon property. it works fine. at some times it works fine, but the one shown above also happens sometimes and once it happens, it never disappears even if players / you reconnect, not only for me but for other players. I don't have any other script that has weapon properties customized, I restarted server and it works fine now, idk what's causing it. Only solution for me when it happens is to restart the server. Could it be AK's getting affected by the anim loop stop? idk.. but i have the ID defined minigun on it. function onWeaponSystemStart() for _, skillname in ipairs({"poor", "std", "pro"}) do setWeaponProperty( 30, skillname, "accuracy", 1 ) setWeaponProperty( 38, skillname, "anim_loop_stop", 0.5 ) setWeaponProperty( 38, skillname, "anim2_loop_stop", 0.5 ) setWeaponProperty( 38, skillname, "damage", 40) end end addEventHandler("onResourceStart", resourceRoot, onWeaponSystemStart)
  12. Hi i changed my AK-47 accuracy, it works fine, however, whenever i'm attached to something EX: glue to a vehicle, it goes weird, it stops animation like every 3 secs. anyone know how to fix? maybe some properties can do the trick if element is attached, etc etc? if so what property?
  13. and that's because you disabled a whole group, you need to find the index. anyway, I have a code that disables most gunshots, M4/AK is still around here i think since i didn't want to disable the rustler/seasparrow sound...( but M4/AK sounds are not noticeable if it has a custom sound anyway.. unlike Deagle, etcs) what type of sounds do u want to disable? anyway here: local removedIDs = { 33, 4, 28, 21, 22, 23, 6, 7, 8, 29, 30, 17, 18, 26, 27, 52, 53, 5, 0, 1, 2, 12, 14, 15, 16, 11 } setWorldSoundEnabled ( 5, true) for i, sound in pairs(removedIDs) do setWorldSoundEnabled(5, sound, false) end Just play with it, see what IDs u wanna remove / add. It's all weapon sounds btw.
  14. It's been almost month since we last posted, Of course we're nearing our 1.0 release, only maps are being worked on right now, Here are the current screenshots we have NOTE: 80% of our scripts have been reworked, redesigned, and optimized. There are also tons of new stuff have been added since our last update here! Bored of typical DayZ, survival servers which you can't freely do what you want? or some Zombie TDM servers that lack content and you easily get bored? this server is the answer! we have a mixture of Survival, RPG, TDM , also you can RP here! which is a better experience and you will never get bored! We have Gangs/Groups, for you to invite your mates and fight other Gangs/Groups, a new DM experience. Also what's shown on the screenshots below is just a 1/4 of the server we have more than that. The rest is for you to discover and experience, cheers. Bored of the typical nemesis bosses? sure we have a nemesis boss too, but he's way stronger and his machinegun accuracy is over the top. We currently have 5 Main bosses and 3 Mini bosses right now, TOTAL: 8 Bosses, including minibosses. BOSSES: Main bosses: Mutant, Tyrant, Orion, Nemesis, Goliath (Tyrant, Goliath isn't shown on the screenshots below) Mini Bosses: Immolator, Supersoldier, Protein (Protein, Immolator isn't shown on the screenshots below) Screenshots of Bosses: Screenshots of framework, login panel etcs: Gameplay contents, Levels are hard to earn here, not at an early phase, but mostly if youre level 10 above, thus, we added rewards for your hardwork, such as Nano-suits, and more! Mission windows, etcs shown below. Things you can do(not all): Rescue Zone aka Red-Cross(RC) - Rescue Mission Extort Zone - Opposite of Rescue Mission ( Rebel Perspective ) Horde-Clear - Clearing Hordes of Zombies Rebel-Truck - A Skirmish between the Military and the Rebels Cargo-Drops - Cargo dropped filled with loot Mystery-Planes - Crashed military planes filled with loot, with peds guarding inside City-Wide Airstrikes - Air-strikes in 3 Major cities occur every hour Settlements / Settlement-Wars - Settlements for you to capture and profit from it and yes Bosses and more for you to see!. Bored of typical zombies? we have different zombie types! We also have a thing called the "Blacklight Zone" which you cannot enter if you do not have an antivirus or a "hazmat suit", zombies are stronger there and more durable. Teaser of map: And for the last thing! We have settlements here! which you can capture and earn profit from it every 30 minutes! similar to turfing, but to capture it, you need to kill the peds guarding it!, also the players guarding it! a fun experience. We have around 15+ Settlements around the map, each belonging to different teams, which the owner can be changed if captured. Interested? Join us on http://www.zo-aftermath.net or send me a PM! we're releasing officialy very soon enough.
  15. That is because you are placing a loop inside a loop. What exactly are you trying to achieve? You need to simplify / optimize your code, try not to put a loop inside another loop. Instead of this: for i,team in pairs(getElementsByType("team")) do if (tonumber(countPlayersInTeam(team))>=1) then for v,playerTeam in ipairs (getPlayersInTeam(team)) do if getElementParent(playerTeam) == arenaElement then local teams = getTeamFromName ( tostring(team) ) if not teams then if not team == scoreboard["teamName"][team] then table.insert(scoreboard,{"teamName",team}) end end end if getElementParent(playerTeam) == arenaElement then table.insert(scoreboard,{"player",playerTeam}) end end end end Maybe try this: local team = getElementsByType("team") local teamCount = countPlayersInTeam ( team ) if teamCount >= 1 then for v,playerTeam in ipairs (getPlayersInTeam(team)) do if getElementParent(playerTeam) == arenaElement then local teams = getTeamFromName ( tostring(team) ) if not teams then if not team == scoreboard["teamName"][team] then table.insert(scoreboard,{"teamName",team}) end end end if getElementParent(playerTeam) == arenaElement then table.insert(scoreboard,{"player",playerTeam}) end end end I don't know what you're trying to achieve but I removed the first loop you had which might be the cause of the problem you have. also tonumber in countPlayersInTeam is not necessary.
  16. buildingSF = createObject(9900, -1055.4000244141, 1298.1999511719, 59, 0, 0, 0) local x, y, z = getElementPosition(buildingSF) objLowLOD = createObject ( 5154, x,y,z,0,0,0,true ) setLowLODElement ( buildingSF, objLowLOD ) engineSetModelLODDistance ( 5154, 300 ) tried this example from the wiki, but it doesn't work, only the lowlod object is visible from afar, anyone knows how to be able to see created buildings from afar? EDIT: fixed, i missed the bool: isLowLod. setLowLODElement is no longer necessary. EDIT #2: Also, im wondering if converting .map files to lua files are safe and won't cause any lags? im refering to Patrick's converter, since i might consider replacing some of my map files to lua ones.
  17. local mrk = createMarker(254.03366, 78.57809, 1003.64062 -1, "cylinder", 1.5, 70,130,85) setElementInterior(mrk,6) local destroyM = createMarker(-2408.79712, -590.94116, 132.64844 -1, "cylinder", 3, 255, 0, 0) -- OPEN PANEL -- addEventHandler("onMarkerHit", mrk, function(onHit) if isElement(onHit) and getElementType(onHit) == "player" then triggerClientEvent(onHit, "LS:AbrirMarkerPOL", onHit) end end ) -- -- Destroy Function function destroy(player) if isElementWithinMarker(player, destroyM) then local theVehicle = getPedOccupiedVehicle(player) if theVehicle then if isElement(veh[player]) then destroyElement(veh[player]) elseif isElement(veh[player]) then destroyElement(veh2[player]) elseif isElement(veh3[player]) then destroyElement(veh3[player]) elseif isElement(veh4[player]) then destroyElement(veh4[player]) end outputChatBox("", player, 255,255,255,true) else outputChatBox("", player, 255,255,255,true) end end end addEventHandler("onMarkerHit", destroyM, destroy) -- -- Give Viatura 01 veh = {} function spawnVehicleVTR() if veh[source] and isElement( veh[source] ) then destroyElement(veh[source]) veh[source] = nil end veh[source] = createVehicle(490, -2421.15649, -608.30200, 132.56250) local x, y, z = getElementPosition(veh[source]) setElementInterior(source, 0) setElementPosition(source, x, y, z+2) warpPedIntoVehicle(source, veh[source]) outputChatBox("#00FF00 Jefatura | #FFFFFF Patrulla 1 Seleccionada.", source, 255, 255, 255, true) end addEvent("LS:GiveVTR", true) addEventHandler("LS:GiveVTR", root, spawnVehicleVTR) -- -- Give Rocam veh3 = {} function spawnVehicleRocam() if veh3[source] and isElement( veh3[source] ) then destroyElement(veh3[source]) veh3[source] = nil end veh3[source] = createVehicle(523, 1586.75207, -1671.39477, 6.61896) local x, y, z = getElementPosition(veh3[source]) setElementInterior(source, 0) setElementPosition(source, x, y, z+2) warpPedIntoVehicle(source, veh3[source]) outputChatBox("#00FF00 Jefatura | #FFFFFF Patrulla Seleccionado.", source, 255, 255, 255, true) end addEvent("LS:GiveRocam", true) addEventHandler("LS:GiveRocam", root, spawnVehicleRocam) Here, i dont think the setElementPosition is necessary, but just put that so i can make sure you'll arrive at your car. it's just a checker if it will work, later on you can try to remove the setElementPosition see if it still works. anyways you had two functions that had the same name, I changed the two function names. make sure to add checks on the destroyElements. also I suggest using getPedOccupiedVehicle check instead of isPedInVehicle.
  18. Bean666

    Sync peds?

    noticed that. tested already with someone , hell looks terrible hahaha, any ideas u can suggest? or what functions to use or what do i need to get and set.
  19. Bean666

    Sync peds?

    wdyt about this? tried it on myself, without the sync yet, setelementposition with bool false doesnt look weird. curious what itll look like to other players. Send zombie element to server: triggerServerEvent("zombieSyncServer", resourceRoot, zombie) Server, get position of zombie: addEvent("zombieSyncServer", true) function syncSendToClient (ped, x, y, z) -- get all players except for the one that triggered the the event -- local players = getElementsByType("player") for i=1, #players do if players[i] == client then table.remove(players, i) break end end -- -- local Zx, Zy, Zz = getElementPosition(ped) triggerClientEvent(players, "zombieSyncClient", resourceRoot, ped, Zx, Zy, Zz) end addEventHandler("zombieSyncServer", root, syncSendToClient) back to client: addEvent("zombieSyncClient", true) function syncReceiveFromServer (ped, x, y, z) setElementPosition ( ped, x, y, z, false ) end addEventHandler("zombieSyncClient", root, syncReceiveFromServer) I don't know what im doing for now but that's what i came up first with.
  20. Bean666

    Sync peds?

    so will it be okay if i only send the message while the ped is following? so it would look smoother than it was? forget the attacking, etc etc.
  21. Bean666

    Sync peds?

    I can see that as well, so anyway to do this without having to put it on the 100 ms function?
  22. Bean666

    Sync peds?

    let's say i put this on the trackMe function, which initiates every 100 ms, would that be fine? or would I have to create it's own timer that's not 100 ms since I feel like that would eat bandwidth or something. What do you suggest?
  23. aren't you setting interior of a function name? try replacing with the veh3[source] if u mean u want to set the interior of the car to 0. veh3 = {} function spawnVehicle() if veh3[source] and isElement( veh3[source] ) then destroyElement(veh3[source]) veh3[source] = nil end veh3[source] = createVehicle(523, 1586.75207, -1671.39477, 6.61896) setElementInterior(veh3[source], 0) warpPedIntoVehicle(source, veh3[source])
  24. Use this to check if player changed dimension then put the replaceModel function instead of rendering the replaceModel function. https://wiki.multitheftauto.com/wiki/OnClientElementDimensionChange note: never tried it, just an idea, but it might work, i feel like rendering the replace model functions would really cause lag since it just spams. EDIT: tried something like this, it works, goodluck. function SA_Model() local txd = engineLoadTXD("test.txd", 202 ) engineImportTXD(txd , 202) local dff = engineLoadDFF("test.dff", 202) engineReplaceModel(dff , 202) end function VC_Model() local txd = engineLoadTXD("test2.txd", 202 ) engineImportTXD(txd , 202) local dff = engineLoadDFF("test2.dff", 202) engineReplaceModel(dff , 202) end addEventHandler ( "onClientElementDimensionChange", localPlayer, function ( oldDimension, newDimension ) if oldDimension == 0 then VC_Model() outputChatBox("check 1") elseif newDimension == 0 then SA_Model() outputChatBox("check 0") end end )
  25. yeah my bad, forgot to mention that.
×
×
  • Create New...