Jump to content

Bean666

Members
  • Posts

    732
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Bean666

  1. Bean666

    Hud problem

    Hi, i got this hud from the community, it works perfect but if player has above 100 health, like he changed hp stats to higher number, the hud disappears like this: normal: What's causing this? Client.lua: --> Scripted by.: Bence Developer --> Blur --> Crash addEventHandler( "onClientMinimize", root, function() blurShader = nil end ) local screenSource = dxCreateScreenSource(screenX, screenY) blurShader = nil addEventHandler("onClientPreRender", root, function() blurShader = dxCreateShader("shaders/blur.fx") if (blurShader) then dxUpdateScreenSource(screenSource) dxSetShaderValue(blurShader, "ScreenSource", screenSource) dxSetShaderValue(blurShader, "BlurStrength", 3) dxSetShaderValue(blurShader, "UVSize", screenX, screenY) for k, v in ipairs(hudComponents) do if not hudClosed or (hudClosed and k < 2) then dxDrawImageSection ( v[1], v[2], v[3], v[4], v[1], v[2], v[3], v[4], blurShader) end end end end ) addEventHandler("onClientRender", root, function() if (hudClosed) then state = "down" else state = "up" end dxDrawImage(switchArrowPositions[1], switchArrowPositions[2], switchArrowPositions[3], switchArrowPositions[4], "images/arrow-"..state..".png") for k, v in ipairs(hudComponents) do if (k == 1) then dxDrawRectangle(v[1], v[2], 47*x, 47*y, tocolor(0, 0, 0, 225)) local avatarID = getElementData(localPlayer, "avatarID") or 1 dxDrawImage(v[1], v[2], 47*x, 47*y, "images/avatars/"..avatarID..".png") if (isMouseInPosition(v[1], v[2], 47*x, 47*y)) then dxDrawRectangle(v[1], v[2], 47*x, 47*y, tocolor(0, 0, 0, 175)) dxDrawText("Change", v[1], v[2], 47*x+v[1], 47*y+v[2], tocolor(250, 250, 250, 250), 1, roboto_9px, "center", "center") end dxDrawRectangle(v[1]+52*x, v[2], v[3]-52*x, v[4], tocolor(0, 0, 0, 225)) local playerName = getPlayerName(localPlayer) dxDrawText(playerName, v[1]+58*x, v[2]+4*y, v[3]-52*x, v[4], tocolor(250, 250, 250, 255), 1, roboto_13px, "left", "top", false, false, false, true) dxDrawRectangle(v[1]+58*x+((v[3]-66*x)/100)*0, v[2]+29*y, 2*x, 12*y, tocolor(255, 255, 255, 250)) dxDrawRectangle(v[1]+58*x+((v[3]-66*x)/100)*25, v[2]+29*y, 2*x, 12*y, tocolor(255, 255, 255, 250)) dxDrawRectangle(v[1]+58*x+((v[3]-66*x)/100)*50, v[2]+29*y, 2*x, 12*y, tocolor(255, 255, 255, 250)) dxDrawRectangle(v[1]+58*x+((v[3]-66*x)/100)*75, v[2]+29*y, 2*x, 12*y, tocolor(255, 255, 255, 250)) dxDrawRectangle(v[1]+58*x+((v[3]-66*x)/100)*100, v[2]+29*y, 2*x, 12*y, tocolor(255, 255, 255, 250)) local playerHealth = getElementHealth(localPlayer) local playerArmor = getPedArmor(localPlayer) local healthColor = getHealthColor(playerHealth) local armorColor = getArmorColor(playerArmor) dxDrawRectangle(v[1]+58*x, v[2]+31*y, (v[3]-66*x)/100*playerHealth, 8*y, tocolor(healthColor[1], healthColor[2], healthColor[3], 210)) dxDrawRectangle(v[1]+58*x, v[2]+31*y, (v[3]-66*x)/100*playerArmor, 8*y, tocolor(armorColor[1], armorColor[2], armorColor[3], 125)) local oxygenLevel = getPedOxygenLevel(localPlayer) if (isElementInWater(localPlayer)) then dxDrawRectangle(v[1]+58*x, v[2]+39*y, (v[3]-64*x)/1000*oxygenLevel, 2*y, tocolor(28, 56, 51, 255)) end end if not (hudClosed) then if (k == 2) then dxDrawRectangle(v[1], v[2], 47*x, 47*y, tocolor(0, 0, 0, 225)) dxDrawImage(v[1], v[2], 47*x, 47*y, "images/money.png") dxDrawRectangle(v[1]+52*x, v[2], v[3]-52*x, v[4], tocolor(0, 0, 0, 225)) local playerMoney = getPlayerMoney(localPlayer) dxDrawText("$"..formatNumber(playerMoney), v[1]+52*x, v[2], v[3]-52*x+v[1]+52*x, v[4]+v[2], tocolor(250, 250, 250, 250), 1, roboto_16px, "center", "center") elseif (k == 3) then dxDrawRectangle(v[1], v[2], 47*x, 47*y, tocolor(0, 0, 0, 225)) dxDrawImage(v[1], v[2], 47*x, 47*y, "images/weapon.png") dxDrawRectangle(v[1]+52*x, v[2], 52*x, v[4], tocolor(0, 0, 0, 225)) local totalAmmo = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer) local playerWeapon = getPedWeapon(localPlayer) if (playerWeapon == 0) then totalAmmo = "-" end dxDrawText(totalAmmo, v[1]+52*x, v[2], 52*x+v[1]+52*x, v[4]+v[2], tocolor(250, 250, 250, 255), 1, roboto_13px, "center", "center") dxDrawRectangle(v[1]+109*x, v[2], 47*x, v[4], tocolor(0, 0, 0, 225)) local ammo = getPedAmmoInClip (localPlayer) local playerWeapon = getPedWeapon(localPlayer) if (playerWeapon == 0) then ammo = "-" end dxDrawText(ammo, v[1]+109*x, v[2], 47*x+v[1]+109*x, v[4]+v[2], tocolor(250, 250, 250, 255), 1, roboto_13px, "center", "center") dxDrawRectangle(v[1]+160*x, v[2], 94*x, v[4], tocolor(0, 0, 0, 225)) local playerWeapon = getPedWeapon(localPlayer) dxDrawText(weaponNameByID[playerWeapon], v[1]+160*x, v[2], 94*x+v[1]+160*x, v[4]+v[2], tocolor(250, 250, 250, 255), 1, roboto_13px, "center", "center") elseif (k == 4) then dxDrawRectangle(v[1], v[2], 104*x, v[4], tocolor(0, 0, 0, 225)) local time = getRealTime() local hour = time.hour local minute = time.minute if (hour < 10) then hour = "0"..hour end if (minute < 10) then minute = "0"..minute end dxDrawText(""..hour..":"..minute.."", v[1], v[2], 104*x+v[1], v[4]+v[2], tocolor(250, 250, 250, 255), 1, roboto_12px, "center", "center") dxDrawRectangle(v[1]+109*x, v[2], 70*x, v[4], tocolor(0, 0, 0, 225)) local playerFPS = getElementData(localPlayer, "player:fps") or 60 local fpsColor = getFPSColor(playerFPS) dxDrawText(""..playerFPS.." FPS", v[1]+109*x, v[2], 70*x+v[1]+109*x, v[4]+v[2], tocolor(fpsColor[1], fpsColor[2], fpsColor[3], 255), 1, roboto_12px, "center", "center") dxDrawRectangle(v[1]+184*x, v[2], 70*x, v[4], tocolor(0, 0, 0, 225)) local playerPing = getPlayerPing(localPlayer) local pingColor = getPingColor(playerPing) dxDrawText(playerPing.." ms", v[1]+184*x, v[2], 70*x+v[1]+184*x, v[4]+v[2], tocolor(pingColor[1], pingColor[2], pingColor[3], 255), 1, roboto_12px, "center", "center") end end end end ) addEventHandler ( "onClientClick", root, function(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) if (button == "left" and state == "down") then if (isMouseInPosition (switchArrowPositions[1], switchArrowPositions[2], switchArrowPositions[3], switchArrowPositions[4])) then hudClosed = not hudClosed end for k, v in ipairs(hudComponents) do if (k == 1) then if (isMouseInPosition(v[1], v[2], 47*x, 47*y)) then openChangeAvatarMenu() end end end end end ) function getHealthColor(health) if (health > 0) then if (health <= 100) and (health > 50) then return {238, 71, 71} elseif (health <= 50) and (health > 25) then return {235, 52, 52} elseif (health <= 25) and (health > 0) then return {176, 24, 24} end else return {198, 195, 195} end end function getArmorColor(armor) if (armor > 0) then if (armor <= 100) and (armor > 75) then return {20, 161, 204} elseif (armor <= 75) and (armor > 50) then return {20, 204, 84} elseif (armor <= 50) and (armor > 25) then return {204, 164, 20} elseif (armor <= 25) and (armor > 0) then return {204, 20, 20} end else return {20, 161, 204} end end function getFPSColor (fps) if (fps > 0) then if (fps <= 100) and (fps > 40) then return {255, 255, 255} elseif (fps <= 40) and (fps > 25) then return {255, 255, 255} elseif (fps <= 25) and (fps > 0) then return {255, 255, 255} end end end function getPingColor (ping) if (ping > 0) then if (ping <= 60) and (ping > 0) then return {255, 255, 255} elseif (ping <= 120) and (ping > 60) then return {255, 255, 255} elseif (ping > 120) then return {255, 255, 255} end end end another clientfile: --> Scripted by.: Bence Developer --> Screen screenX, screenY = guiGetScreenSize() x, y = screenX/1366, screenY/768 --> HUD Closed hudClosed = false --> Fonts roboto_8px = dxCreateFont("fonts/roboto.ttf", 8*x) roboto_9px = dxCreateFont("fonts/roboto.ttf", 9*x) roboto_12px = dxCreateFont("fonts/roboto.ttf", 12*x) roboto_13px = dxCreateFont("fonts/roboto.ttf", 13*x) roboto_16px = dxCreateFont("fonts/roboto.ttf", 16*x) roboto_20px = dxCreateFont("fonts/roboto.ttf", 20*x) --> Positions switchArrowPositions = {screenX-(311*x), 10*y, 47*x, 47*y} hudComponents = { {screenX-(264*x), 10*y, 254*x, 47*y}, {screenX-(264*x), 62*y, 254*x, 47*y}, {screenX-(264*x), 114*y, 254*x, 47*y}, {screenX-(264*x), 166*y, 254*x, 25*y}, } boxPositions = {screenX/2-225*x/2, screenY/2-125*y/2, 225*x, 125*y} --> Weapon names weaponNameByID = { [0] = "Fist", [1] = "B. Knuckle", [2] = "Golfclub", [3] = "Nightstick", [4] = "Knife", [5] = "Bat", [6] = "Shovel", [7] = "Poolstick", [8] = "Katana", [9] = "Chainsaw", [22] = "Colt 45", [23] = "Silenced", [24] = "Deagle", [25] = "Shotgun", [26] = "Sawed-off", [27] = "SPAZ-12", [28] = "Uzi", [29] = "MP5", [32] = "Tec-9", [30] = "AK-47", [31] = "M4", [33] = "Rifle", [34] = "Sniper", [35] = "Rocket L.", [36] = "HS. R. L.", [37] = "Flame T.", [38] = "Heavy MG", [16] = "Grenade", [17] = "Teargas", [18] = "Molotov", [39] = "Satchel", [41] = "Spraycan", [42] = "Fire Extin.", [43] = "Camera", [10] = "Dildo", [11] = "Dildo", [12] = "Vibrator", [14] = "Flower", [15] = "Cane", [44] = "Nightvision", [45] = "Infrared", [46] = "Parachute", [40] = "Detonator", } addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() setPlayerHudComponentVisible("all", false) setPlayerHudComponentVisible ("crosshair", true ) end ) addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), function() setPlayerHudComponentVisible("all", true) if (blurShader) then blurShader = nil end end ) function showCursorBind () showCursor(not isCursorShowing()) end bindKey("K", "down", showCursorBind) --> Calculate FPS fpsTick = 0 addEventHandler("onClientPreRender", root, function() fpsTick = fpsTick + 1 end ) setTimer( function() setElementData(localPlayer, "player:fps", fpsTick) fpsTick = 0 end, 1000, 0 ) --> Usefull functions function isMouseInPosition (x, y, width, height) if (not isCursorShowing()) then return false end local cx, cy = getCursorPosition () local cx, cy = ( cx * screenX ), ( cy * screenY ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end function formatNumber(number) while true do number, k = string.gsub(number, "^(-?%d+)(%d%d%d)", '%1 %2') if k==0 then break end end return number end function dxDrawLinedRectangle( x, y, width, height, color, _width, postGUI ) _width = _width or 1 dxDrawLine ( x, y, x+width, y, color, _width, postGUI ) -- Top dxDrawLine ( x, y, x, y+height, color, _width, postGUI ) -- Left dxDrawLine ( x, y+height, x+width, y+height, color, _width, postGUI ) -- Bottom return dxDrawLine ( x+width, y, x+width, y+height, color, _width, postGUI ) -- Right end function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI) if (x and y and w and h) then if (not borderColor) then borderColor = tocolor(0, 0, 0, 200); end if (not bgColor) then bgColor = borderColor; end dxDrawRectangle(x, y, w, h, bgColor, postGUI); dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); end end function dxDrawBorderedText (outline, text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) for oX = (outline * -1), outline do for oY = (outline * -1), outline do dxDrawText (text, left + oX, top + oY, right + oX, bottom + oY, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) end end dxDrawText (text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) end
  2. Bean666

    Turf System?

    then I should be fine with JSON i guess, my server's not that big and it's still ongoing so yeah i should be fine, thanks anyway <3. i created a JSON file with the sample u gave, i dont need to put the json file in the meta.xml right? first time trying JSON.
  3. Bean666

    Turf System?

    thank you i couldnt ask for more, but yes im using this for my project, whats the difference if i'll use mySQL tho?
  4. Bean666

    Turf System?

    that's actually pretty cool if you do, I would be glad to test it, and I will learn from it as well. thankyou!
  5. Server has been renamed to: International Zombie Community RPG, We are open for beta-test, join us now! IP: mtasa://195.201.242.13:22003 Night Zombies: Recolored spawn panel and added a few changes.
  6. Bean666

    Turf System?

    Hello, what functions would I need to make a simple turf system? I know i'll need the createColCuboid but how do i get gang names, players in gang, etc? as they don't have a function for it, as I only know getTeamFromName and getPlayersinTeam How can i get players inside a "gang" elementdata? do I do a loop like this? local players = getElementsWithinColShape( turfarea, "player" ) for i, v in ipairs(players) do local gangname = getElementData(v, "gang") if gangname ~= ?? then -- idk how to get the gangname that's taking the colshape either. this just shows if gangname is different from turf owner setRadarAreaFlashing(turfarea, true) -- capturing turf setTimer etc etc -- timer for capture etc --- I have so much to know about making a simple turf system, If anyone could help about what functions to use, thankyou.
  7. Bean666

    Timer C-side

    oh thanks, and anyway, the "drawxp" event hanlder, i can change the localPlayer, to root right? since it doesnt really matter as long as you trigger the clientevent for a certain variable, and it wont trigger to others, and root is faster right?
  8. Bean666

    Timer C-side

    function drawxp(xpfromserver) xptogive = xpfromserver removetimer = setTimer(function() xptogive = false end, 3*1000, 1) end addEvent("drawxp", true) addEventHandler("drawxp", localPlayer, drawxp) function onWasted(killer, weapon, bodypart) if ( killer and getElementType(killer) == "player" and getElementType(source) == "ped" ) then if killer == localPlayer then if getElementData(source, "zombie") == true then if isTimer(removetimer) then killTimer(removetimer) outputChatBox("killed timer") end end end end end addEventHandler("onClientPedWasted", getLocalPlayer(), onWasted) basically, like this?
  9. Bean666

    Timer C-side

    Hi, I noticed my client-side timer was getting killed when another player kills a ped too. so I decided to add a getLocalPlayer() to the killer variable, but will this work?, will this not kill my timer if another player kills a ped, since I added a getLocalPlayer() now? I don't have anyone to test with rn but I just wanna ask, if this doesn't work, do I need to add a timer table like serverside-timers(player-based) instead? I tried adding a local before the removetimer but doing that, the timer can't be recognized by the event onClientPedWasted, but removing the local caused the timer to be killed by other players as well that's why I added a getLocalPlayer() on the killer variable, but im not sure if it will work. function drawxp(xpfromserver) xptogive = xpfromserver removetimer = setTimer(function() xptogive = false end, 3*1000, 1) end addEvent("drawxp", true) addEventHandler("drawxp", localPlayer, drawxp) function onWasted(killer, weapon, bodypart) if ( killer and getElementType(killer) == "player" and getElementType(source) == "ped" ) then if killer == getLocalPlayer() then if getElementData(source, "zombie") == true then if isTimer(removetimer) then killTimer(removetimer) outputChatBox("killed timer") end end end end end addEventHandler("onClientPedWasted", getRootElement(), onWasted)
  10. so this script shows if u enter marker a DX text shows up, but when two of us enter the market, an error shows up: addEventHandler("onClientPreRender" with this function is already handled. line 142, how to fix this? line 142 is: function draw() for i, c in ipairs(bombteams) do if getPlayerTeam ( localPlayer ) and getPlayerTeam ( localPlayer ) == getTeamFromName(c[1]) then dxDrawText("Protect and escort the bomb truck", (700/1920)*sx, (71/1080)*sy, (1278/1920)*sx, (103/1080)*sy, tocolor(200, 200, 0, 255), (1.00/1920)*sx, "bankgothic", "left", "top", false, false, false, false, false) end end for i, c in ipairs(alliedteams) do if getPlayerTeam ( localPlayer ) and getPlayerTeam ( localPlayer ) == getTeamFromName(c[1]) then dxDrawText("Stop and defuse the bomb truck", (700/1920)*sx, (71/1080)*sy, (1278/1920)*sx, (103/1080)*sy, tocolor(110, 208, 30, 255), (1.00/1920)*sx, "bankgothic", "left", "top", false, false, false, false, false) end end end function drawprotect(localPlayer) addEventHandler("onClientPreRender", getRootElement(), draw) -- THIS IS 142 end addEvent("drawprotect", true) addEventHandler("drawprotect", root, drawprotect) function markerHit(localPlayer) if source == attachedmarker then if ( localPlayer == getLocalPlayer() and getElementType ( localPlayer ) == "player" ) then if isTimer(datatimer) then killTimer(datatimer) end if Bombstart == false then return end local playerTeam = getPlayerTeam ( localPlayer ) setElementData(localPlayer , "participated", true) drawprotect(localPlayer) end end end addEventHandler("onClientMarkerHit", resourceRoot, markerHit)
  11. what do you mean, set their status to wait? that's already on the chase_move function I think its just the checks, whenever I tried to fix the debug errors showing up by adding checks they start to act weird I think i've found the problem but let's see again if he acts like this, basically here: else -- if the ped isnt stuck if px and py and pz and oldTx and oldTy and oldTz then -- I had this on if oldPx and oldPy and oldPz and px and py and pz, which does not match the distance variable local distance = (getDistanceBetweenPoints3D(px, py, pz, oldTx, oldTy, oldTz)) if (distance > 5) then -- if the ped hasnt reached its target local flatdist = (getDistanceBetweenPoints2D(px, py, tx, ty)) if flatdist < 2 then -- if the ped hasnt reached its target, but is directly below or above (for multiple levels in maps) setTimer(beginsearch, 800, 1, ped) else -- keep going local angle = (360 - math.deg(math.atan2((oldTx - px), (oldTy - py)))) % 360 setTimer(chase_move, 600, 1, ped, oldTx, oldTy, oldTz, px, py, pz) end else -- if the ped has reached its target ( reached the spot it last saw you standing in) setTimer(beginsearch, 800, 1, ped) end end end end end EDIT: but yeah they started walking again when I died despite having the check corrected, maybe put the setTimer(chase_move) after the check? im realy confused
  12. yes I removed the elses I've put on the first code, first they were fine but now there's something wrong again hahaha, it seems like the bots are not updating when I die: I also edited the changestatus and removed the else function changestatus(dataName) if getElementType(source) == "ped" and dataName == "status" and (getElementData(source, "slothbot") == true) then if (getElementData(source, "status") == "chasing") then local player = getElementData(source, "target") if isElement(player) then -- HERE local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(chase_aim, 80, 1, source) setTimer(chase_move, 700, 1, source, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) setTimer(chase_shoot, 1500, 1, source) end setTimer(chase_move, 700, 1, source, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) elseif (getElementData(source, "status") == "hunting") then local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(enemy_check, 600, 1, source) -- starts scanning for enemies setTimer(hunt_move, 800, 1, source, oldPx, oldPy, oldPz, oldPx, oldPy, oldPz) elseif (getElementData(source, "status") == "following") then local player = getElementData(source, "leader") local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(follow_enemy_check, 500, 1, source) setTimer(follow_move, 800, 1, source, oldPx, oldPy, oldPz, oldPx, oldPy, oldPz) elseif (getElementData(source, "status") == "waiting") then setTimer(wait_enemy_check, 500, 1, source) elseif (getElementData(source, "status") == "guarding") then setTimer(guard_enemy_check, 800, 1, source) -- starts scanning for enemies setTimer(guard_move, 400, 1, source) end end end addEventHandler("onClientElementDataChange", getRootElement(), changestatus) server function changestatus(dataName) if getElementType(source) == "ped" and dataName == "status" and (getElementData(source, "slothbot") == true) then if (getElementData(source, "status") ~= "stasis") then local allshapes = getElementsByType("colshape") for SKey, theShape in ipairs(allshapes) do if (isElement(theShape)) then if getElementParent(theShape) == source then destroyElement(theShape) -- removes the target colshape that the ped was running towards in hunt mode end end end end if (getElementData(source, "status") == "chasing") then local player = getElementData(source, "target") if isElement(player) then -- HERE local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(chase_move, 700, 1, source, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) end setTimer(chase_move, 700, 1, source, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) elseif (getElementData(source, "status") == "hunting") then setTimer(findPath, 200, 1, source) elseif (getElementData(source, "status") == "waiting") then setTimer(wait_mode, 200, 1, source) elseif (getElementData(source, "status") == "following") then local player = getElementData(source, "leader") local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(follow_move, 700, 1, source, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) elseif (getElementData(source, "status") == "guarding") then local px, py, pz = getElementPosition(source) guard_move(source, px, py, pz) end end end addEventHandler("onElementDataChange", getRootElement(), changestatus)
  13. seems to be working fine, as the other first code with many elses, ill give an update whenever the boss acts like on the video again..
  14. okay i removed an else, but see if this code would work fine? I removed the else and the extra chase_move function and just added the check instead, this is mostly all the same on the chase_move function on serverside, there are multiple lines like these. if oldPx and oldPy and oldPz and px and py and pz then local pdistance = (getDistanceBetweenPoints3D(oldPx, oldPy, oldPz, px, py, pz)) if (pdistance < 1) and (inrange == 0) then -- if the ped is stuck but not in range of the player local weap = getPedWeaponSlot(ped) if (weap == 1) or (weap == 7) then setPedWeaponSlot(ped, 0) triggerClientEvent("bot_Jump", ped) setTimer(setPedWeaponSlot, 850, 1, ped, weap) else triggerClientEvent("bot_Jump", ped) end setTimer(chase_move, 600, 1, ped, tx, ty, tz, px, py, pz) else setTimer(chase_move, 600, 1, ped, tx, ty, tz, px, py, pz) end end
  15. I added else since when I didn't, they didnt recognize me and won't attack me. I've always did the checks without the else, they just won't attack me. But okay i'll try once again and remove the elses,
  16. Hello, This has been bugging me for quite a while now, and it's even weirder as this happens not always, sometimes only, but that is the flaw here, I managed to edit slothbot a bit, making the boss run when he's far and when he's near setting ped animation, thats all I did and since the original slothbot was giving errors, and I was not happy about it, so I edited it a bit, to remove those showing errors, here are the errors: so I managed to remove the errors by doing checks where the errors show, bot works perfectly, but there are times like these, happening, see video below: Now, here are the parts of the vanilla slothbot code I modified, none other, just those. can you tell me which part makes him behave like that? its weird since it doesn't always happen, just barely but its still a big flaw: C SIDE: ALL PARTS I EDITED, and i put detailed marks where I modified it. please try and compare to the vanilla slothbot to see what's wrong. Thankyou. i NOTE: I suggest checking this on Notepad++ since the code is too big to fit on this MTA forums screen. Any help appreciated, thankyou.! Clientside: function changestatus(dataName) if getElementType(source) == "ped" and dataName == "status" and (getElementData(source, "slothbot") == true) then if (getElementData(source, "status") == "chasing") then local player = getElementData(source, "target") if isElement(player) then -- THIS I MODIFIED, ADDED CHECK local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(chase_aim, 80, 1, source) setTimer(chase_move, 700, 1, source, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) setTimer(chase_shoot, 1500, 1, source) else setTimer(chase_aim, 80, 1, source) setTimer(chase_move, 700, 1, source, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) setTimer(chase_shoot, 1500, 1, source) end elseif (getElementData(source, "status") == "hunting") then local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(enemy_check, 600, 1, source) -- starts scanning for enemies setTimer(hunt_move, 800, 1, source, oldPx, oldPy, oldPz, oldPx, oldPy, oldPz) elseif (getElementData(source, "status") == "following") then local player = getElementData(source, "leader") local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(follow_enemy_check, 500, 1, source) setTimer(follow_move, 800, 1, source, oldPx, oldPy, oldPz, oldPx, oldPy, oldPz) elseif (getElementData(source, "status") == "waiting") then setTimer(wait_enemy_check, 500, 1, source) elseif (getElementData(source, "status") == "guarding") then setTimer(guard_enemy_check, 800, 1, source) -- starts scanning for enemies setTimer(guard_move, 400, 1, source) end end end addEventHandler("onClientElementDataChange", getRootElement(), changestatus) function chase_move(ped, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) if (isElement(ped)) then local thetarget = getElementData(ped, "target") if (getElementData(ped, "status") == "chasing") and (isElement(thetarget)) and (getElementData(ped, "slothbot") == true) then local pedhp = getElementHealth(ped) local tarhp = getElementHealth(thetarget) if pedhp > 0 and tarhp > 0 then local tx, ty, tz = getElementPosition(thetarget) local px, py, pz = getElementPosition(ped) local isclear = isLineOfSightClear(px, py, pz + .6, tx, ty, tz + .6, true, false, false, true, false, false, false) local angle = (360 - math.deg(math.atan2((tx - px), (ty - py)))) % 360 --set the peds angle to the target setPedRotation(ped, angle) if (isclear == true) then -- if the ped can see the target local angle = (360 - math.deg(math.atan2((tx - px), (ty - py)))) % 360 --set the peds angle to the target setPedRotation(ped, angle) setElementData(ped, "seestarget", true) setTimer(chase_move, 700, 1, ped, tx, ty, tz, px, py, pz) else local angle = (360 - math.deg(math.atan2((oldTx - px), (oldTy - py)))) % 360 --set the peds angle to the target setPedRotation(ped, angle) setElementData(ped, "seestarget", false) if oldTx and oldTy and oldTz and oldPx and oldPy and oldPz then -- THIS I MODIFIED, ADDED CHECK setTimer(chase_move, 700, 1, ped, oldTx, oldTy, oldTz, px, py, pz) end end end end end end function resourcestart() local players = getElementsByType("player") if #players == 1 then local peds = getElementsByType("ped") for theKey, thePed in ipairs(peds) do if (getElementData(thePed, "slothbot") == true) then triggerServerEvent("onClientSetBotController", thePed, thePed) local pedstatus = getElementData(thePed, "stasisstatus") if (pedstatus ~= false) then setElementData(thePed, "status", pedstatus) setElementData(thePed, "stasisstatus", nil) else setElementData(thePed, "status", "hunting") end end end else local peds = getElementsByType("ped") for theKey, thePed in ipairs(peds) do if (getElementData(thePed, "status") == "chasing") then local player = getElementData(thePed, "target") if isElement(player) then -- THIS I MODIFIED, ADDED CHECK local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(thePed) setTimer(chase_aim, 80, 1, thePed) setTimer(chase_move, 700, 1, thePed, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) setTimer(chase_shoot, 1500, 1, thePed) else setTimer(chase_aim, 80, 1, source) setTimer(chase_move, 700, 1, source, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) setTimer(chase_shoot, 1500, 1, source) end elseif (getElementData(thePed, "status") == "hunting") then local oldPx, oldPy, oldPz = getElementPosition(thePed) setTimer(enemy_check, 600, 1, thePed) -- starts scanning for enemies setTimer(hunt_move, 800, 1, thePed, oldPx, oldPy, oldPz, oldPx, oldPy, oldPz) elseif (getElementData(thePed, "status") == "following") then local player = getElementData(thePed, "leader") local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(thePed) setTimer(follow_enemy_check, 500, 1, thePed) setTimer(follow_move, 800, 1, thePed, oldPx, oldPy, oldPz, oldPx, oldPy, oldPz) elseif (getElementData(thePed, "status") == "waiting") then setTimer(wait_enemy_check, 500, 1, thePed) elseif (getElementData(thePed, "status") == "guarding") then setTimer(guard_enemy_check, 800, 1, thePed) -- starts scanning for enemies setTimer(guard_move, 400, 1, thePed) end end end end addEventHandler("onClientResourceStart", resourceRoot, resourcestart) Server Side same with C side, here are some parts I edited with marks on them: All Marks are - "ADDED CHECK HERE" and "ADDED ELSE HERE" function changestatus(dataName) if getElementType(source) == "ped" and dataName == "status" and (getElementData(source, "slothbot") == true) then if (getElementData(source, "status") ~= "stasis") then local allshapes = getElementsByType("colshape") for SKey, theShape in ipairs(allshapes) do if (isElement(theShape)) then if getElementParent(theShape) == source then destroyElement(theShape) -- removes the target colshape that the ped was running towards in hunt mode end end end end if (getElementData(source, "status") == "chasing") then local player = getElementData(source, "target") if isElement(player) then -- THIS I MODIFIED ADDED CHECK HERE local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(chase_move, 700, 1, source, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) else setTimer(chase_move, 700, 1, source, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) end elseif (getElementData(source, "status") == "hunting") then setTimer(findPath, 200, 1, source) elseif (getElementData(source, "status") == "waiting") then setTimer(wait_mode, 200, 1, source) elseif (getElementData(source, "status") == "following") then local player = getElementData(source, "leader") local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(follow_move, 700, 1, source, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) elseif (getElementData(source, "status") == "guarding") then local px, py, pz = getElementPosition(source) guard_move(source, px, py, pz) end end end addEventHandler("onElementDataChange", getRootElement(), changestatus) function chase_move(ped, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) if (isElement(ped)) then if (getElementData(ped, "status") == "chasing") and (getElementData(ped, "slothbot") == true) then local px, py, pz = getElementPosition(ped) local player = getElementData(ped, "target") if (isElement(player)) then local tx, ty, tz = getElementPosition(player) local pedhp = getElementHealth(ped) if getElementType(player) == "player" then if pedhp > 0 and (isPedDead(player) == false) then if (getElementData(ped, "seestarget") == true) then -- if the ped can see the target local inrange = 0 local tdist = (getDistanceBetweenPoints3D(px, py, pz, tx, ty, tz)) if (getPedWeaponSlot(ped) == 0) then -- fists triggerClientEvent("bot_Forwards", ped) inrange = 0 if tdist > 5 then setPedAnimation ( ped, "PED", "sprint_civi", -1, true, true, true) elseif tdist < 5 then setPedAnimation ( ped) end elseif (getPedWeaponSlot(ped) == 1) then -- melee triggerClientEvent("bot_Forwards", ped) inrange = 0 elseif (getPedWeaponSlot(ped) == 2) then -- pistols if tdist < 14 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 3) then -- shotguns if tdist < 10 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 4) then -- submachine if tdist < 7 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 5) then -- assault if tdist < 14 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 6) then --rifles if tdist < 22 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 7) then --heavy if tdist < 12 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 8) then --projectiles (dont work afaik) triggerClientEvent("bot_Forwards", ped) inrange = 0 elseif (getPedWeaponSlot(ped) == 9) then -- special if tdist < 2 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 10) then -- gifts triggerClientEvent("bot_Forwards", ped) inrange = 0 elseif (getPedWeaponSlot(ped) == 11) then -- special2 triggerClientEvent("bot_Forwards", ped) inrange = 0 elseif (getPedWeaponSlot(ped) == 12) then -- detonator triggerClientEvent("bot_Forwards", ped) inrange = 0 else -- probably useless part. triggerClientEvent("bot_Forwards", ped) inrange = 0 end if oldPx and oldPy and oldPz and px and py and pz then -- THIS I MODIFIED ADDED CHECK HERE local pdistance = (getDistanceBetweenPoints3D(oldPx, oldPy, oldPz, px, py, pz)) if (pdistance < 1) and (inrange == 0) then -- if the ped is stuck but not in range of the player local weap = getPedWeaponSlot(ped) if (weap == 1) or (weap == 7) then setPedWeaponSlot(ped, 0) triggerClientEvent("bot_Jump", ped) setTimer(setPedWeaponSlot, 850, 1, ped, weap) else triggerClientEvent("bot_Jump", ped) end setTimer(chase_move, 600, 1, ped, tx, ty, tz, px, py, pz) else setTimer(chase_move, 600, 1, ped, tx, ty, tz, px, py, pz) end else setTimer(chase_move, 1200, 1, ped, tx, ty, tz, px, py, pz) -- ADDED AN ELSE HERE OF IF OLD PX, etc end else -- if the ped cant see the target if oldPx and oldPy and oldPz and px and py and pz then -- ADDED A CHECK HERE triggerClientEvent("bot_Forwards", ped) local pdistance = (getDistanceBetweenPoints3D(oldPx, oldPy, oldPz, px, py, pz)) if (pdistance < 1.2) then --if the ped is stuck local decide = math.random(1, 7) -- randomly decide to if decide == 1 then -- give up chasing and go back on the hunt setTimer(beginsearch, 800, 1, ped) elseif decide < 4 then -- jump local weap = getPedWeaponSlot(ped) if (weap == 1) or (weap == 7) then setPedWeaponSlot(ped, 0) triggerClientEvent("bot_Jump", ped) setTimer(setPedWeaponSlot, 850, 1, ped, weap) else triggerClientEvent("bot_Jump", ped) end setTimer(chase_move, 600, 1, ped, tx, ty, tz, px, py, pz) else -- randomly turn a new direction, walk a bit, then resume local randomangle = math.random(1, 360) setPedRotation(ped, randomangle) setTimer(chase_move, 1200, 1, ped, tx, ty, tz, px, py, pz) end else setTimer(chase_move, 1200, 1, ped, tx, ty, tz, px, py, pz) -- ADDED AN ELSE HERE end else -- if the ped isnt stuck if oldPx and oldPy and oldPz and px and py and pz then -- ADDED A CHECK HERE local distance = (getDistanceBetweenPoints3D(px, py, pz, oldTx, oldTy, oldTz)) if (distance > 5) then -- if the ped hasnt reached its target local flatdist = (getDistanceBetweenPoints2D(px, py, tx, ty)) if flatdist < 2 then -- if the ped hasnt reached its target, but is directly below or above (for multiple levels in maps) setTimer(beginsearch, 800, 1, ped) else -- keep going local angle = (360 - math.deg(math.atan2((oldTx - px), (oldTy - py)))) % 360 -- setPedRotation( ped, angle ) setTimer(chase_move, 600, 1, ped, oldTx, oldTy, oldTz, px, py, pz) end else -- if the ped has reached its target ( reached the spot it last saw you standing in) setTimer(beginsearch, 800, 1, ped) end end end end else -- ADDED AN ELSE HERE IF CHECK DONT EXIST, DO CHASE_MOVE setTimer(chase_move, 1200, 1, ped, tx, ty, tz, px, py, pz) end elseif getElementType(player) == "ped" then if pedhp > 0 and (getElementHealth(player) > 0) then if (getElementData(ped, "seestarget") == true) then -- if the ped can see the target local inrange = 0 local tdist = (getDistanceBetweenPoints3D(px, py, pz, tx, ty, tz)) if (getPedWeaponSlot(ped) == 0) then -- fists triggerClientEvent("bot_Forwards", ped) inrange = 0 if tdist > 5 then setPedAnimation ( ped, "PED", "sprint_civi", -1, true, true, true) elseif tdist < 5 then setPedAnimation ( ped) end elseif (getPedWeaponSlot(ped) == 1) then -- melee triggerClientEvent("bot_Forwards", ped) inrange = 0 elseif (getPedWeaponSlot(ped) == 2) then -- pistols if tdist < 14 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 3) then -- shotguns if tdist < 10 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 4) then -- submachine if tdist < 8 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 5) then -- assault if tdist < 17 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 6) then --rifles if tdist < 22 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 7) then --heavy if tdist < 12 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 8) then --projectiles (dont work afaik) triggerClientEvent("bot_Forwards", ped) inrange = 0 elseif (getPedWeaponSlot(ped) == 9) then -- special if tdist < 2 then triggerClientEvent("bot_Stop", ped) inrange = 1 else triggerClientEvent("bot_Forwards", ped) inrange = 0 end elseif (getPedWeaponSlot(ped) == 10) then -- gifts triggerClientEvent("bot_Forwards", ped) inrange = 0 elseif (getPedWeaponSlot(ped) == 11) then -- special2 triggerClientEvent("bot_Forwards", ped) inrange = 0 elseif (getPedWeaponSlot(ped) == 12) then -- detonator triggerClientEvent("bot_Forwards", ped) inrange = 0 else -- probably useless part. triggerClientEvent("bot_Forwards", ped) inrange = 0 end if oldPx and oldPy and oldPz and px and py and pz then -- ADDED A CHECK HERE local pdistance = (getDistanceBetweenPoints3D(oldPx, oldPy, oldPz, px, py, pz)) if (pdistance < 1) and (inrange == 0) then -- if the ped is stuck but not in range of the target local weap = getPedWeaponSlot(ped) if (weap == 1) or (weap == 7) then setPedWeaponSlot(ped, 0) triggerClientEvent("bot_Jump", ped) setTimer(setPedWeaponSlot, 850, 1, ped, weap) else triggerClientEvent("bot_Jump", ped) end setTimer(chase_move, 700, 1, ped, tx, ty, tz, px, py, pz) else setTimer(chase_move, 700, 1, ped, tx, ty, tz, px, py, pz) end else setTimer(chase_move, 700, 1, ped, tx, ty, tz, px, py, pz) -- ADDED AN ELSE HERE DO CHASEMOVE IF NO CHECK - BEAN end else if oldPx and oldPy and oldPz and px and py and pz then -- ADDED A CHECK HERE local pdistance = (getDistanceBetweenPoints3D(oldPx, oldPy, oldPz, px, py, pz)) if (pdistance < 1.3) then --if the ped is stuck local decide = math.random(1, 7) -- randomly decide to if decide == 1 then -- give up chasing and go back on the hunt setTimer(beginsearch, 800, 1, ped) elseif decide < 4 then -- jump local weap = getPedWeaponSlot(ped) if (weap == 1) or (weap == 7) then local slot = getPedWeaponSlot(ped) setPedWeaponSlot(ped, 0) triggerClientEvent("bot_Jump", ped) setTimer(setPedWeaponSlot, 850, 1, ped, slot) else triggerClientEvent("bot_Jump", ped) end setTimer(chase_move, 700, 1, ped, tx, ty, tz, px, py, pz) else -- randomly turn a new direction, walk a bit, then resume local randomangle = math.random(1, 360) setPedRotation(ped, randomangle) setTimer(chase_move, 1200, 1, ped, tx, ty, tz, px, py, pz) end else -- if the ped isnt stuck local distance = (getDistanceBetweenPoints3D(px, py, pz, oldTx, oldTy, oldTz)) if (distance > 5) then -- if the ped hasnt reached its target local flatdist = (getDistanceBetweenPoints2D(px, py, tx, ty)) if flatdist < 2 then -- if the ped hasnt reached its target, but is directly below or above (for multiple levels in maps) setTimer(beginsearch, 800, 1, ped) else -- keep going setTimer(chase_move, 700, 1, ped, oldTx, oldTy, oldTz, px, py, pz) end else -- if the ped has reached its target ( reached the spot it last saw you standing in) setTimer(beginsearch, 800, 1, ped) end end else -- ADDED AN ELSE HERE, IF NO CHECK, CHASE_MOVE - BEAN setTimer(chase_move, 1200, 1, ped, tx, ty, tz, px, py, pz) end end else setTimer(beginsearch, 800, 1, ped) end end else setTimer(beginsearch, 800, 1, ped) end end end end NOTE: this seldom happens so its probably I missed one small thing or did one thing wrong! and I only added checks to those lines that gave errors! I have been trying to fix this many times but now I just cant seem to fix it no matter how hard I tried, and decided to ask for help here.
  17. oh so it wouldn't matter if i put root instead of getLocalPlayer() on the addEventHandler?
  18. oh okay thanks but what about if I want to show a "GUI" or "DX" to a certain player, is using getLocalPlayer() or localPlayer fine on the addEventHandler? function showgui() guiSetVisible(wear, true) guiSetVisible(cancel, true) guiSetAlpha(wear, 0) guiSetAlpha(cancel, 0) showCursor(true) addEventHandler("onClientPreRender", getRootElement(), drawpurifier) end addEvent("showgui", true) addEventHandler("showgui", getLocalPlayer(), showgui) addEventHandler("onMarkerHit", resourceRoot, function(hitElement) if source == rmarker3 then if getElementType( hitElement ) == "player" then if getElementData(hitElement, "purifier") == "true" then outputChatBox("You are already a purifier", hitElement, 255, 0, 0) return end triggerClientEvent(hitElement, "showgui", hitElement) end end end)
  19. Client: function onBossEventEnd() removehp() stopmusic() end addEvent("onBossEventEnd", true) addEventHandler("onBossEventEnd", getRootElement(), onBossEventEnd) Server: triggerClientEvent(root, "onBossEventEnd", root) something like this?
  20. Hello, thankyou! but can you help me once again here, So basically this shows that everytime the boss dies theres a loop that goes thru players and checks if they have the bossparticipated data to true, we killed the boss and a player got the exp and rewards despite not joining the fight, the data is turned to true by attacking the boss, which he wasnt present at the time, so why was this triggered? idk if its possible or he was joking but can u see if there are reasons why that happened or if its possible to happen? C Side ( the damage and data set to true ) function bossdamaged ( attacker, weapon, bodypart ) if getElementType ( source ) == "ped" then if (getElementData (source, "boss") == true) or (getElementData(source, "soldier") == true) or (getElementData(source, "scientist") == true) then if isTimer(bosshptimer) then killTimer(bosshptimer) end triggerServerEvent ("bossdamaged", source, source, attacker, weapon, bodypart ) cancelEvent() end if getElementData(source, "boss") == true then if getElementData(attacker, "bossparticipated") == true then return end setElementData(attacker, "bossparticipated", true) end end end addEventHandler ( "onClientPedDamage", getRootElement(), bossdamaged) S Side ( the reward and loop ) function bossdeath ( ) if source == bossz then if isTimer(refreshtimer) then killTimer(refreshtimer) end triggerClientEvent(root, "removehp", root) triggerClientEvent(root, "stopmusic", root) for i,v in ipairs(getElementsByType("player")) do toggleControl(v, "jump", true) if getElementData(v, "bossparticipated") == true then local amount = math.random(30000, 50000) local expamount = math.random(8000, 10000) givePlayerMoney(v, amount) exports["amlevelsystem"]:addPlayerXp(v, expamount); outputChatBox("+"..tonumber(amount).."$ +"..tonumber(expamount).." EXP", v, 0, 255, 0, true) setTimer(function() setElementData(v, "bossparticipated", false) end, 1000, 1) end end
  21. i even tried using showsound but firing one shot from a gun shows not just one index so its pretty confusing.
  22. Hello i disabled original weapons sound using setWorldSoundEnabled ( 5, false ), all of them, but the reload seems to be affected, what is the index ID for the reload sound so I can enable it?, also the punching sound is gone
  23. Hello, what is the recommended FPS limit for a server?, I like to run mine on 60 FPS Locked, is it safe?, only 60 FPS not above 60 FPS.
  24. WE RENAMED -- International Zombie Community RPG-- --International Zombie Community RPG-- Introduction: International Zombie Community RPG, for short: IZC is a server composed of multiple genres such as Zombies, RPG, and War, basically, we're different from most zombie servers, where they just kill, levelup, etc, here we got more missions and jobs, but mostly, jobs are locked to civilians, and jobs are restricted in the safezones, outside the safezones, it's hell and war. Current Factions / Teams San Andreas Military Forces The remnants of the military of san andreas, they're the ones that try to keep order, but not in the most humane way They do provide law and order, and save civilians, but if you defy their orders, it will be a hell to pay They have dark secrets of their own, and will do anything to have order in their hands no matter what They currently reside in Tierra Robada, as their former base in Bone county was overrun by the infected. United Liberation Front A Heavily-Armed resistance group that stood up against the SAMF due to disagreements ULF is a very dangerous group and a high threat to the SAMF, as they are composed of armed soldiers and very skilled EX-Special Ops members. They currently reside somewhere in Red County. Civilians Remnants of the civilian population in San Andreas and they live in safezones There are 2 safezones in San Andreas, one is military held and one is survivor held, due to survivors escaping the military held safezone and made their own safezone as the military is very brutal to the civilian population if disagreements are met. Outlaws Outlaws of San Andreas They are part of the survivor community but they are segregated from the civilian community as they are brutal savages that like to go around and kill people for their own desires. Note: 95% of the images / clips are done alone, multiple players in clips / photos will come soon for a better perspective. Current Features: Login Panel Screenshot: Video(OUTDATED): Spawn panel Army's side of the spawn panel REDESIGNED: Custom Animations Idle armed animation + Crouch armed Level System Level bar: Boss System Rewards after killing boss: Civilian Jobs Fisherman GUI: Lumberjack cutting tree: Skin-selection GUI Improved Combat System Kevlar Screenshots / Clips will be released soon Military / Rebel Jobs / Missions Rescue Zones(Military, Civilians) ULF/Rebel bomb truck mission + Military defusing bomb truck Bombed military outpost: Military defusing: Supply Delivery for Army and Rebels(both have) Airstrike Zones Group Panel A super-human suit aka Purifier Weapon shop Black Market(More available equipment and weapons): Custom map with base labels on map Hud, Radar Improved zombies, stronger and faster( especially at night) Save System and maps with quality, modded objects, and shaders Screenshots / Clips will be released soon There are still more to come! Please stay tuned! Screenshots / videos(Current state): Maps: We are in BETA state and will open BETA a few days from now, so please don't expect much and report any bugs if seen, I'm the only scripter / developer of this server and I'm not a very perfect one, I can manage to do my things from learning and asking help from generous and helpful people. to those interested in this project, do not hesitate to PM me or such. We are currently in need of developers, such as mappers, scripters(if someone volunteers), and especially! beta testers and players. I can handle most scripts so far by asking for help and learning new things as I'm not a very experienced scripter but I'm learning pretty well!, but if someone volunteers to help, I would gladly accept it, don't hesitate to pm if you're interested in this project. Please stay tuned for more information and photos / clips, thank you. -Aftermath Staff Team -Bean Special Thanks To: @IIYAMA, @Tekken for helping me with tons of scripts, helping me learn new things. and Tekken's Level System.
  25. thanks i got another small issue i wonder if you could help with this, this is C-side and it's got localPlayer, it triggers an event where u click u respawn, but 1 time i died, didnt click respawn button, but probably one other player did, my character got respawned, why tho? elseif (source == respawnb ) then setTimer(function() setElementData(localPlayer, "dead", false) end, 2500, 1) guiSetVisible(respawn, false) setTimer(function() triggerServerEvent("respawndeath", localPlayer) showCursor(false) end, 2000, 1) the event: function respawndeath() setPedStat (client, 24, 570) local playerDeathTeam = getPlayerTeam ( client) if ( playerDeathTeam and getTeamName ( playerDeathTeam ) == "San Andreas Military Forces" ) then if getElementData(client, "Class") == "Spec Ops" then spawnPlayer ( client, 2105.529296875, 892.4794921875, 15.768750190735, 268.6) return end setElementData(client, "threat", "low"); spawnPlayer ( client, -1507.4235839844, 2530.9812011719, 56.012500762939) elseif ( playerDeathTeam and getTeamName ( playerDeathTeam ) == "United Liberation Front" ) then setElementData(client, "threat", "low"); spawnPlayer ( client, 128.16796875, -279.15234375, 1.578125) elseif ( playerDeathTeam and getTeamName ( playerDeathTeam ) == "Outlaws" ) then setElementData(client, "threat", "low"); spawnPlayer ( client, -550.44415283203, -2724.2612304688, 138.04649353027) elseif ( playerDeathTeam and getTeamName ( playerDeathTeam ) == "Civilians" ) then setElementData(client, "threat", "low"); spawnPlayer ( client, 2308.8642578125, -9.3994140625, 32.53125) end end addEvent("respawndeath", true) addEventHandler("respawndeath", root, respawndeath) i see nothing wrong with it, perhaps the "client" element? do I change it to source instead? or do i define localPlayer as = getLocalPlayer() instead?, localPlayer is pre defined right? so I wont have to do the if localPlayer == getLocalPlayer()?
×
×
  • Create New...