Jump to content

Anthrax

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by Anthrax

  1. Hola a todos necesito urgente este recurso o script, mi server esta estancado y no puedo hacer nuevas mejoras... e buscado y programado sin exito alguno ya se que hay un recurso de zombies (el de slothman) https://community.multitheftauto.com/in ... ils&id=347 pero el problema es que los zombies salen globalmente, osea que en el recurso pongo que salgan 10 zombies y solo saldran maximo 10 zombies para los 40 players(solamente 10 zombie no mas), pero cuando los players se van a otros lugares ya no les aparece ningun zombie, el primer player que entro y se fue a otro lugar se agarro los 10 zombies.... Lo que necesito es que los zombies salgan personalmente (client) osea pongo en el recurso que salgan 10 zombies y los 40 players pueden ver sus 10 zombies personalmente(que los demas tambien puedan verlos) Porfavor algun alma de caridad que pueda ayudarme con este problema, mi server no puede avanzar, no tengo mucho tiempo para scriptear y este problema lo tengo desde siempre.... con gusto lo hago admin en mi server Saludos
  2. Algo asi? y como añado el click del mouse? function () setTimer(function(player) bindKey(player, "f", "down", ) bindKey(player, "g", "down", ) end,1000, 1,source)
  3. Si, ya había revisado ese post, no lo detecta. Ademas solo avisa cuando alguien usa el programa al admin y no da kick. y no puedo editarlo ya que esta compilado. Si es posible que el script detecte las teclas rapidas en cualquier tipo de ataques, que no sea necesario en todas las teclas Saludos
  4. Hola a todos, necesito su ayuda, necesito hacer una especie de anti-hack y no se como hacerlo. Lo que pasa es que los players usan el autohotkey para matar a los enemigos de 1 solo golpe. Lo que hace esto es hacer varias veces el ataque la tecla sin presionarla, es como hacer 100 clics (presionar el boton de ataque) cada 1 segundo Aqui el video del programa que usan: E estado pensando añadir todas las teclas incluido los clics del mouse en una especie antispam, y al momento de detectar esa rapidez en las teclas darle kick al player. Este es el script: antiSpam = {} function antiChatSpam() if isTimer(antiSpam[source]) then cancelEvent() outputChatBox("#ffffff"..getPlayerName(source).." #ff6600estas muteado por hacer spam! ( 5 minutos )", getRootElement(), 255, 255, 0,true) setPlayerMuted(source, true) setTimer ( autoUnmute, 300000, 1, source) else antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 1000, 1, source) end end addEventHandler("onPlayerChat", root, antiChatSpam) function autoUnmute ( player ) if ( isElement ( player ) and isPlayerMuted ( player ) ) then setPlayerMuted ( player, false ) outputChatBox ("#FFFFFF"..getPlayerName ( player ).." #ff6600estas desmuteado, no vuelvas a hacer spam -.-",getRootElement(), 255, 255, 0,true ) end end Favor de solucionar mi problema en lo mas rapido posible Saludos
  5. Anthrax

    Vote abuse

    hola a todos, estoy teniendo problemas con el recurso votemanager. Pues lo que quiero es que "todos jugadores" hagan votes cada 5 minutos (votemode, votemap). ya cambie la configuración para que se haga eso cada 5 minutos pero solo lo hace para un solo jugador. por ejemplo: yo entro y hago un votemode, para yo haga otro votemode tengo que esperar 5 minutos. Pero entra otro jugador y el si puede hacer un votemode. ( lo que quiero es impedir eso, que se cumpla los 5 minutos del vote a nivel global) Espero que me ayuden. les dejo el script del votemanager (son varios) --votemanager_client.lua local rootElement = getRootElement() local voteWindow local boundVoteKeys = {} local nameFromVoteID = {} local voteIDFromName = {} local optionLabels = {} local isVoteActive local hasAlreadyVoted = false local isChangeAllowed = false local timeLabel local finishTime local cacheVoteNumber local cacheTimer local layout = {} layout.window = { width = 150, relative = false, alpha = 0.85, } layout.title = { posX = 10, posY = 25, width = layout.window.width, relative = false, alpha = 1, r = 100, g = 100, b = 250, font = "default-bold-small", } layout.option = { posX = 10, width = layout.window.width, relative = false, alpha = 1, r = 200, g = 200, b = 200, font = "default-normal", bottom_padding = 4, --px } layout.cancel = { posX = 10, width = layout.window.width, height = 16, relative = false, alpha = 1, r = 120, g = 120, b = 120, font = "default-normal", } layout.time = { posX = 0, width = layout.window.width, height = 16, relative = false, alpha = 1, r = 255, g = 255, b = 255, font = "default-bold-small", } layout.chosen = { alpha = 1, r = 255, g = 130, b = 130, font = "default-bold-small", } layout.padding = { bottom = 10, } local function updateTime() local seconds = math.ceil( (finishTime - getTickCount()) / 1000 ) guiSetText(timeLabel, seconds) end addEvent("doShowPoll", true) addEvent("doSendVote", true) addEvent("doStopPoll", true) addEventHandler("doShowPoll", rootElement, function (pollData, pollOptions, pollTime) --clear the send vote cache cacheVoteNumber = "" --clear the bound keys table boundVoteKeys = {} --store the vote option names in the array nameFromVoteID nameFromVoteID = pollOptions --then build a reverse table voteIDFromName = {} local width for id, name in ipairs(nameFromVoteID) do voteIDFromName[name] = id width = dxGetTextWidth("1. "..name) + 20 --check if the name width is higher than the current width if layout.window.width < width then --set the curent width to the width of the name layout.window.width = width end end for word in string.gfind(pollData.title, "[^%s]+") do width = dxGetTextWidth(word) + 20 if layout.window.width < width then layout.window.width = width end end --determine if we have to append nomination number local nominationString = "" if pollData.nomination > 1 then nominationString = " (nomination "..pollData.nomination..")" end isChangeAllowed = pollData.allowchange layout.title.width = layout.window.width - 20 layout.option.width = layout.window.width layout.cancel.width = layout.window.width layout.time.width = layout.window.width local screenX, screenY = guiGetScreenSize() --create the window voteWindow = guiCreateWindowFromCache ( screenX, screenY, layout.window.width, screenY, --! "Vote"..nominationString, layout.window.relative ) guiSetAlpha(voteWindow, layout.window.alpha) --create the title label local titleLabel = guiCreateLabelFromCache( layout.title.posX, layout.title.posY, layout.title.width, 0, --! pollData.title, layout.title.relative, voteWindow ) local titleHeight = guiLabelGetFontHeight(titleLabel) * math.ceil(guiLabelGetTextExtent(titleLabel) / layout.title.width) guiSetSize(titleLabel, layout.title.width, titleHeight, false) guiLabelSetHorizontalAlign ( titleLabel, "left", true ) guiLabelSetColor(titleLabel, layout.title.r, layout.title.g, layout.title.b) guiSetAlpha(titleLabel, layout.title.alpha) guiSetFont(titleLabel, layout.title.font) setElementParent(titleLabel, voteWindow) local labelY = layout.title.posY + titleHeight --for each option, bind its key and create its label for index, option in ipairs(pollOptions) do --bind the number key and add it to the bound keys table local optionKey = tostring(index) bindKey(optionKey, "down", sendVote_bind) bindKey("num_"..optionKey, "down", sendVote_bind) table.insert(boundVoteKeys, optionKey) --create the option label optionLabels[index] = guiCreateLabelFromCache( layout.option.posX, labelY, layout.option.width, 0, optionKey..". "..option, layout.option.relative, voteWindow ) -- -[[ FIXME - wordwrap --local optionHeight = guiLabelGetFontHeight(optionLabels[index]) * -- math.ceil(guiLabelGetTextExtent(optionLabels[index]) / layout.option.width) local optionHeight = 16 guiSetSize(optionLabels[index], layout.option.width, titleHeight, false) guiLabelSetHorizontalAlign ( optionLabels[index], "left", true ) --]] guiLabelSetColor(optionLabels[index], layout.option.r, layout.option.g, layout.option.b) guiSetAlpha(optionLabels[index], layout.option.alpha) setElementParent(optionLabels[index], voteWindow) labelY = labelY + optionHeight + layout.option.bottom_padding end --bind 0 keys if there are more than 9 options if #pollOptions > 9 then bindKey("0", "down", sendVote_bind) bindKey("num_0", "down", sendVote_bind) table.insert(boundVoteKeys, "0") end if isChangeAllowed then bindKey("backspace", "down", sendVote_bind) --create the cancel label cancelLabel = guiCreateLabelFromCache( layout.cancel.posX, labelY, layout.cancel.width, layout.cancel.height, "(Backspace to cancel)", layout.cancel.relative, voteWindow ) guiLabelSetHorizontalAlign ( cancelLabel, "left", true ) guiLabelSetColor(cancelLabel, layout.cancel.r, layout.cancel.g, layout.cancel.b) guiSetAlpha(cancelLabel, layout.cancel.alpha) setElementParent(cancelLabel, voteWindow) labelY = labelY + layout.cancel.height end --create the time label timeLabel = guiCreateLabelFromCache( layout.time.posX, labelY, layout.time.width, layout.time.height, "", layout.time.relative, voteWindow ) guiLabelSetColor(timeLabel, layout.time.r, layout.time.g, layout.time.b) guiLabelSetHorizontalAlign(timeLabel, "center") guiSetAlpha(timeLabel, layout.time.alpha) guiSetFont(timeLabel, layout.time.font) setElementParent(timeLabel, voteWindow) labelY = labelY + layout.time.height --adjust the window to the number of options local windowHeight = labelY + layout.padding.bottom guiSetSize(voteWindow, layout.window.width, windowHeight, false) guiSetPosition(voteWindow, screenX - layout.window.width, screenY - windowHeight, false)
  6. Si DanielZ3RO tiene razon, yo tambien tengo ese mismo problema, en que las cabezas no se eliminan. como puedo eliminar eso? me gustaria saber Este es el ultimo script del goremod outputChatBox("#00FF00>>#FFFF00This server using#FF0000 Gore Mod#FFFF00 made by #00FF00Crazy",255,0,0,true) --[[ for i,v in ipairs(getElementsByType("player")) do setElementData(source,"last_damage",0,false) end for i,v in ipairs(getElementsByType("ped")) do setElementData(source,"last_damage",0,false) end]] --Structure=ID,X rotation,Z rotation,boneID parts = { {2908,-90,-90,6}, --head {2907,-90,0,3}, --torso {2906,-90,-180,33}, --lA {2906,-90,0,23}, --rA {2905,-90,-90,42}, --lL {2905,-90,-90,52} --rL } koef = {[0]=1, [1]=1, [2]=2, [3]=2, [4]=2, [5]=2, [6]=2, [7]=2, [8]=2, [9]=2, [22]=3, [23]=3, [24]=3, [25]=5, [26]=5, [27]=5, [28]=4, [29]=4, [32]=4, [30]=4, [31]=4, [33]=5, [34]=5, [35]=7, [36]=7, [37]=0, [38]=7, [16]=7, [17]=0, [18]=0, [39]=6, [41]=0, [42]=0, [43]=0, [10]=1, [11]=1, [12]=1, [13]=1, [14]=1, [15]=1, [44]=0, [45]=0, [46]=0, [40]=0, [19]=7, [37]=0, [50]=8, [51]=7, [53]=0, [54]=0, [59]=7} function createBloodAtPos(theElement) local x,y,z = getElementPosition(theElement) fxAddBlood(x,y,z,0,0,3,100) end --[[ function onDamage(attacker,weapon,part,loss) if not loss then loss = 0 end setElementData(source,"last_damage",loss,false) end]] function onRender() for i,v in ipairs(getElementsByType("object",getResourceRootElement(getThisResource()))) do if math.random(1,5) == 1 then createBloodAtPos(v) end end for i,v in ipairs(getElementsByType("sound",getResourceRootElement(getThisResource()))) do setSoundSpeed(v,getGameSpeed()) end end function onPlayerWasted(theKiller,theReason) setElementAlpha(source,0) math.randomseed(getTickCount()) local x,y,z = getElementPosition(source) local x2,y2,z2 if theKiller then x2,y2,z2 = getElementPosition(theKiller) else x2,y2,z2 = getElementPosition(source) x2 = x2 + math.random(-1,1) y2 = y2 + math.random(-1,1) z2 = z2 + math.random(-1,1) end local x1,y1,z1 = getElementPosition(getLocalPlayer()) --Sound play local theSound = playSound("sounds/hit"..tostring(math.random(1,6))..".wav") local dis = getDistanceBetweenPoints3D(x1,y1,z1,x,y,z) setSoundVolume(theSound,1/(dis/10)) setSoundSpeed(theSound,getGameSpeed()) --Meat creating for i,v in ipairs(parts) do local bX,bY,bZ = getPedBonePosition(source,v[4]) local thePart = createObject(v[1],x,y,z,v[2],0,getPedRotation(source)-v[3]) setElementCollisionsEnabled(thePart,false) setElementInterior(thePart,getElementInterior(source)) local oX = x-x2 local oY = y-y2 local vecLength = math.sqrt((oX * oX) + (oY * oY)) oX = oX/vecLength oY = oY/vecLength local k = 1 if theReason ~= 49 then if theReason then k = koef[theReason] end else local vX,vY,vZ = getElementVelocity(theKiller) local actualspeed = (vX^2 + vY^2 + vZ^2)^(0.5) k = actualspeed*20 end oX = x+(oX*k) oY = y+(oY*k) oX = oX + math.random(-1,1) oY = oY + math.random(-1,1) local oZ = getGroundPosition(oX,oY,z) local is,x3,y3,z3 = processLineOfSight(x,y,z,oX,oY,oZ,true,false,false,true,false) if is == true then oX = x3 oY = y3 oZ = z3 end moveObject(thePart,400/getGameSpeed(),oX,oY,oZ,math.random(360),math.random(360),math.random(360)) setTimer(destroyElement,10000,1,thePart) end end function onSpawn() setElementAlpha(source,255) end addEventHandler("onClientPedWasted",getRootElement(),onPlayerWasted) addEventHandler("onClientPlayerWasted",getRootElement(),onPlayerWasted) addEventHandler("onClientPlayerSpawn",getRootElement(),onSpawn) addEventHandler("onClientRender",getRootElement(),onRender) --[[ addEventHandler("onClientPedDamage",getRootElement(),onDamage) addEventHandler("onClientPlayerDamage",getRootElement(),onDamage)]]
  7. ok work, zombies are removed when the player quit of the server . but not work when the player is far on the zombies is the only thing missing and close the post, very thanks manawydan
  8. WOW, almost everything is repaired by manawydan. Only missing the zombies will disappear when the player is very far of the zombies (zombie need respawn only close of the player),because the zombies only stay where spawned. I think that need destroyelemement but how do it that?. Too when the player leave of the server need remove the personal zombies This is the only thing that would fail to complete this post. Very thanks Manawydan you help me as much, I hope you help me with This Last.
  9. ok I tested it, and have the issues 1° the zombies no respawn after dead ("Onzombiewaste" no work, WTF), spawns only once. 2° zombies appears in 1 second after spawn. I think that the zombies need appears 15 seconds after player spawn. I try edit the settimer to 15000 and not work 3° zombies can't respawn when a some player go other places, zombies stay in the same place where they spawned (need remove idle zombies) 4° appears 4 zombies (Isn't relevant) thanks manawydan regards
  10. very thanks manawydan After multiple tries, I forget the resource zombies streammetod in 0 ._. and work fine!. I edit the script for spawn zombies but have the some issues 1° The zombies only spawn when only I start the resource ("onResourceStart"), if I leave and enter again never spawn.I know that I need change for "OnPlayerSpawn" but how to put it with a settimer?? 2° I put "onZombieWasted" for spawn after die, but when I kill one zombie appears 3 more and 3 more until to reach the limit of zombies (30 zombie for 1 player) I need only 3 zombies per player, no more. I use this function zombiesperplayer() local players = getElementsByType("player") for k,v in ipairs(players) do local interior = getElementInterior(v) local dimension = getElementDimension(v) local x,y,z = getElementPosition(v) exports.zombies:createZombie ( x+math.sin(math.rad(-45))*(math.random(1,5)), y+math.cos(math.rad(-45))*(math.random(1,5)), z, math.random(360), nil, interior, dimension ) exports.zombies:createZombie ( x+math.sin(math.rad(-90))*(math.random(1,5)), y+math.cos(math.rad(-90))*(math.random(1,5)), z, math.random(360), nil, interior, dimension ) exports.zombies:createZombie ( x+math.sin(math.rad(-180))*(math.random(1,5)), y+math.cos(math.rad(-180))*(math.random(1,5)), z, math.random(360), nil, interior, dimension ) end end addEventHandler ( "onResourceStart", resourceRoot, zombiesperplayer ) addEvent("onZombieWasted",true) addEventHandler ("onZombieWasted",getRootElement(),zombiesperplayer) Please help me. Regards
  11. I do it in two forms and not work: This way required the original "zombies" script from here https://community.multitheftauto.com/ind ... ls&id=8564 function zombiesperplayer() local players = getElementsByType("player") for k,v in ipairs(players) do local interior = getElementInterior(v) local dimension = getElementDimension(v) local x,y,z = getElementPosition(v) ZOMBIES = exports.zombies:createZombie ( x+math.sin(math.rad(-45))*(math.random(1,5)), y+math.cos(math.rad(-45))*(math.random(1,5)), z, math.random(360), nil, interior, dimension ) ZOMBIES = exports.zombies:createZombie ( x+math.sin(math.rad(-90))*(math.random(1,5)), y+math.cos(math.rad(-90))*(math.random(1,5)), z, math.random(360), nil, interior, dimension ) ZOMBIES = exports.zombies:createZombie ( x+math.sin(math.rad(-180))*(math.random(1,5)), y+math.cos(math.rad(-180))*(math.random(1,5)), z, math.random(360), nil, interior, dimension ) end end This way I edited the line from the original script (zombie_server.lua) (lines 625 to 636) ZombieLimit = get("zombies.MaxZombies")-- HOW MANY ZOMBIES SHOULD EXIST AT MAXIMUM? ZombieStreaming = get("zombies.StreamMethod") -- 1 to constantly stream zombies, 0 to only allow zombies to spawn via createZombie function, 2 to only allow spawning at set spawnpoints ZombiePedSkins = {13,22,56,67,68,69,70,92,97,105,107,108,126,127,128,152,162,167,188,195,206,209,212,229,230,258,264,277,280,287 } --ALTERNATE SKIN LISTS FOR ZOMBIES (SHORTER LIST IS TEXTURED ZOMBIES ONLY) --ZombiePedSkins = {7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,36,37,38,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,66,67,68,69,70,71,72,73,75,76,77,78,79,80,81,82,83,85,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,112,113,114,115,116,117,118,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,151,152,153,154,155,156,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,275,276,277,278,279,280,281,282,283,284,285,286,287,288 } ZombieSpeed = get("zombies.Speed") if ZombieSpeed == 0 then --super slow zombies (goofy looking) chaseanim = "WALK_drunk" checkspeed = 2000 elseif ZombieSpeed == 1 then -- normal speed chaseanim = "run_old" checkspeed = 1000 elseif ZombieSpeed == 2 then -- rocket zombies (possibly stressful on server) chaseanim = "Run_Wuzi" checkspeed = 680 else -- defaults back to normal chaseanim = "run_old" checkspeed = 1000 end resourceRoot = getResourceRootElement() moancount =0 moanlimit = 10 everyZombie = { } --IDLE BEHAVIOUR OF A ZOMBIE function Zomb_Idle (ped) if isElement(ped) then if ( getElementData ( ped, "status" ) == "idle" ) and ( isPedDead ( ped ) == false ) and (getElementData (ped, "zombie") == true) then local action = math.random( 1, 6 ) if action < 4 then -- walk a random direction local rdmangle = math.random( 1, 359 ) setPedRotation( ped, rdmangle ) setPedAnimation ( ped, "PED", "Player_Sneak", -1, true, true, true) setTimer ( Zomb_Idle, 7000, 1, ped ) elseif action == 4 then -- get on the ground setPedAnimation ( ped, "MEDIC", "cpr", -1, false, true, true) setTimer ( Zomb_Idle, 4000, 1, ped ) elseif action == 5 then -- stand still doing nothing setPedAnimation ( ped ) setTimer ( Zomb_Idle, 4000, 1, ped ) end end end end --BEHAVIOUR WHILE CHASING PLAYERS function Zomb_chase (ped, Zx, Zy, Zz ) if isElement(ped) then if (getElementData ( ped, "status" ) == "chasing") and (getElementData (ped, "zombie") == true) then local x, y, z = getElementPosition( ped ) if (getElementData ( ped, "target" ) == nil) and getElementData ( ped, "Tx" ) ~= false then local Px = getElementData ( ped, "Tx" ) local Py = getElementData ( ped, "Ty" ) local Pz = getElementData ( ped, "Tz" ) local Pdistance = (getDistanceBetweenPoints3D( Px, Py, Pz, x, y, z )) if (Pdistance < 1.5 ) then setTimer ( function (ped) if ( isElement ( ped ) ) then setElementData ( ped, "status", "idle" ) end end, 2000, 1, ped ) end end local distance = (getDistanceBetweenPoints3D( x, y, z, Zx, Zy, Zz )) if (distance < 1 ) then -- IF THE PED HASNT MOVED if (getElementData ( ped, "target" ) == nil) then local giveup = math.random( 1, 15 ) if giveup == 1 then setElementData ( ped, "status", "idle" ) else local action = math.random( 1, 2 ) if action == 1 then setPedAnimation ( ped ) triggerClientEvent ( "Zomb_Punch", getRootElement(), ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedAnimation ( ped, "ped", chaseanim, -1, true, true, true ) end end, 800, 1, ped ) setTimer ( Zomb_chase, 2000, 1, ped, x, y, z ) elseif action == 2 then setPedAnimation ( ped ) triggerClientEvent ( "Zomb_Jump", getRootElement(), ped ) setTimer ( Zomb_chase, 3500, 1, ped, x, y, z ) end end else local Ptarget = (getElementData ( ped, "target" )) if isElement(Ptarget) then local Px, Py, Pz = getElementPosition( Ptarget ) local Pdistance = (getDistanceBetweenPoints3D( Px, Py, Pz, Zx, Zy, Zz )) if (Pdistance < 1.2 ) then -- ATTACK A PLAYER IF THEY ARE CLOSE if ( isPedDead ( Ptarget ) ) then --EAT A DEAD PLAYER setPedAnimation ( ped ) setPedAnimation ( ped, "MEDIC", "cpr", -1, false, true, false) setTimer ( function (ped) if ( isElement ( ped ) ) then setElementData ( ped, "status", "idle" ) end end, 10000, 1, ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedRotation ( ped, getPedRotation(ped)-180) end end, 10000, 1, ped ) zmoan(ped) else local action = math.random( 1, 6 ) if action == 1 then setPedAnimation ( ped) triggerClientEvent ( "Zomb_Jump", getRootElement(), ped ) setTimer ( Zomb_chase, 2000, 1, ped, x, y, z ) else setPedAnimation ( ped) triggerClientEvent ( "Zomb_Punch", getRootElement(), ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedAnimation ( ped, "ped", chaseanim, -1, true, true, true ) end end, 800, 1, ped ) setTimer ( Zomb_chase, 2000, 1, ped, x, y, z ) end end else if ( isPedDead (Ptarget) ) then setTimer ( function (ped) if ( isElement ( ped ) ) then setElementData ( ped, "status", "idle" ) end end, 2000, 1, ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedRotation ( ped, getPedRotation(ped)-180) end end, 1800, 1, ped ) else local action = math.random( 1, 2 ) if action == 1 then setPedAnimation ( ped) triggerClientEvent ( "Zomb_Punch", getRootElement(), ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedAnimation ( ped, "ped", chaseanim, -1, true, true, true ) end end, 800, 1, ped ) setTimer ( Zomb_chase, 2000, 1, ped, x, y, z ) elseif action == 2 then setPedAnimation ( ped) triggerClientEvent ( "Zomb_Jump", getRootElement(), ped ) setTimer ( Zomb_chase, 2000, 1, ped, x, y, z ) end end end else setElementData ( ped, "status", "idle" ) end end else setPedAnimation ( ped, "ped", chaseanim, -1, true, true, true) --KEEP WALKING setTimer ( Zomb_chase, checkspeed, 1, ped, x, y, z ) --CHECK AGAIN end end end end --SET THE DIRECTION OF THE ZOMBIE function setangle () for theKey,ped in ipairs(everyZombie) do if isElement(ped) then if ( getElementData ( ped, "status" ) == "chasing" ) then local x local y local z local px local py local pz if ( getElementData ( ped, "target" ) ~= nil ) then local ptarget = getElementData ( ped, "target" ) if isElement(ptarget) then x, y, z = getElementPosition( ptarget ) px, py, pz = getElementPosition( ped ) else setElementData ( ped, "status", "idle" ) x, y, z = getElementPosition( ped ) px, py, pz = getElementPosition( ped ) end zombangle = ( 360 - math.deg ( math.atan2 ( ( x - px ), ( y - py ) ) ) ) % 360 --MAGIC SPELL TO MAKE PEDS LOOK AT YOU setPedRotation( ped, zombangle ) elseif ( getElementData ( ped, "target" ) == nil ) and (getElementData ( ped, "Tx" ) ~= false) then --IF THE PED IS AFTER THE PLAYERS LAST KNOWN WHEREABOUTS x = getElementData ( ped, "Tx" ) y = getElementData ( ped, "Ty" ) z = getElementData ( ped, "Tz" ) px, py, pz = getElementPosition( ped ) zombangle = ( 360 - math.deg ( math.atan2 ( ( x - px ), ( y - py ) ) ) ) % 360 --MAGIC SPELL TO MAKE PEDS LOOK AT YOU setPedRotation( ped, zombangle ) end end end end end --SETS THE ZOMBIE ACTIVITY WHEN STATUS CHANGES addEventHandler ( "onElementDataChange", getRootElement(), function ( dataName ) if getElementType ( source ) == "ped" and dataName == "status" then if (getElementData (source, "zombie") == true) then if ( isPedDead ( source ) == false ) then if (getElementData ( source, "status" ) == "chasing" ) then local Zx, Zy, Zz = getElementPosition( source ) setTimer ( Zomb_chase, 1000, 1, source, Zx, Zy, Zz ) local newtarget = (getElementData ( source, "target" )) if isElement (newtarget) then if getElementType ( newtarget ) == "player" then setElementSyncer ( source, newtarget ) end end zmoan(source) elseif (getElementData ( source, "status" ) == "idle" ) then setTimer ( Zomb_Idle, 1000, 1, source) elseif (getElementData ( source, "status" ) == "throatslashing" ) then local tx,ty,tz = getElementPosition( source ) local ptarget = getElementData ( source, "target" ) if isElement(ptarget) then local vx,vy,vz = getElementPosition( ptarget ) local zombdistance = (getDistanceBetweenPoints3D (tx, ty, tz, vx, vy, vz)) if (zombdistance < .-- s8) --> then zmoan(source) setPedAnimation ( source, "knife", "KILL_Knife_Player", -1, false, false, true) setPedAnimation ( ptarget, "knife", "KILL_Knife_Ped_Damage", -1, false, false, true) setTimer ( Playerthroatbitten, 2300, 1, ptarget, source) setTimer ( function (source) if ( isElement ( source ) ) then setElementData ( source, "status", "idle" ) end end, 5000, 1, source ) else setElementData ( source, "status", "idle" ) end else setElementData ( source, "status", "idle" ) end end elseif (getElementData ( source, "status" ) == "dead" ) then setTimer ( Zomb_delete, 10000, 1, source) end end end end) --RESOURCE START/INITIAL SETUP function outbreak(startedResource) newZombieLimit = get("" .. getResourceName(startedResource) .. ".Zlimit") if newZombieLimit ~= false then if newZombieLimit > ZombieLimit then newZombieLimit = ZombieLimit end else newZombieLimit = ZombieLimit end WoodTimer = setTimer ( WoodSetup, 2000, 1) -- CHECKS FOR BARRIERS if startedResource == getThisResource() then -- call(getResourceFromName("scoreboard"), "scoreboardAddColumn", "Zombie kills") --ADDS TO SCOREBOARD local allplayers = getElementsByType ( "player" ) for pKey,thep in ipairs(allplayers) do setElementData ( thep, "dangercount", 0 ) end local alivePlayers = getAlivePlayers () for playerKey, playerValue in ipairs(alivePlayers) do setElementData ( playerValue, "alreadyspawned", true ) end if ZombieSpeed == 2 then MainTimer1 = setTimer ( setangle, 200, 0) -- KEEPS ZOMBIES FACING THE RIGHT DIRECTION (fast) else MainTimer1 = setTimer ( setangle, 400, 0) -- KEEPS ZOMBIES FACING THE RIGHT DIRECTION end MainTimer3 = setTimer ( clearFarZombies, 3000, 0) --KEEPS ALL THE ZOMBIES CLOSE TO PLAYERS if ZombieStreaming == 1 then MainTimer2 = setTimer ( SpawnZombie, 2500, 0 ) --Spawns zombies in random locations elseif ZombieStreaming == 2 then MainTimer2 = setTimer ( SpawnpointZombie, 2500, 0 ) --spawns zombies in zombie spawnpoints end end end addEventHandler("onResourceStart", getRootElement(), outbreak) function player_Connect() setElementData ( source, "dangercount", 0 ) end
  12. no, better 3 zombie per player, but how to make that??? help me
  13. you remember me some thing important, when a player use the glitch the ping rise so fast that it shown difficult in the scores. Here the script: function DisconnectPlayer( Player ) if ( getPlayerPing( Player ) > 485 ) then kickPlayer ( Player, "Prohibited the disconnection glitch" ) else end end function kickglitcher() setTimer ( DisconnectPlayer, 1000, 1, source ) end addEventHandler ( "onPlayerJoin", getRootElement(), kickglitcher ) the only thing I'm missing is that the rise ping detects in 1 millisecond (line 2), I don't know how to make it? please help me D: Regards
  14. 'onPlayerQuit' is a quit of server voluntarily, isn't what I'm looking for... When a player disconnect and connect your router "very fast", the connection is maintained a bit little second and not quit by connection lost. I need patch this. In other word... kick on a minimal lost connection, not a quit player
  15. Hi all, I need help with this script The script need kick player on minimal disconnect. Because many players used glitch, disconnect and connect very faster your router ( This gives an effect of teleportation ._. ) Here is the script: function onPlayerDisconnect() settimer( kickPlayer, 1000, 1, source, "prohibited the disconnection glitch" ) end addEvent("onPlayerDisconnect", getRootElement(), onPlayerDisconnect) please help me, thanks
  16. yes, I need going off limits (max players 32, 32 * 5 = 160 zombies) , but the most necessary is that each person have 5 zombies, how can I do that?
  17. Plz I need help here D:
  18. Hi all, I need help for this resource. zombies spawn global, when one player join have 100 zombies(maxlimit), but the rest of players haven't zombies. I need that the zombies spawn per player ( 5 zombies per player), for example I join on my server and I have 5 zombies, after join other player and have 5 zombies too, in total have 10 zombies I know that this consume resource on my server plz help me here is the sources: zombie_client.lua http://pastebin.com/hy9Xiv59 zombie_server.lua http://pastebin.com/JYdRQ3rT I download from here: https://community.multitheftauto.com/in ... ils&id=347 Regards
  19. Anthrax

    Bugs :(

    Si esta bien e incluso lo puse con timer, pero ya no importa, ya lo combine con el freeroam y ya no me da error El que me esta dando problema es el spawn de 50p. E visto que los equipos solo se ven cuando entras (haciendo spawn en el script), la posible solución es que los equipos se vean siempre, algún indicio en donde puede ser para poder editarlo???
  20. Si tambien lo puse con OnPlayerJoin y no funcionaba
  21. Anthrax

    Bugs :(

    si que desaparesca cuando no halla nadie en el auto, da un error alli
  22. Anthrax

    Bugs :(

    Hola de nuevo, tengo otro problema con este script de 50p que no se esta añadiendo correctamente los teams aqui lo pueden ver: http://i59.tinypic.com/2hefz92.jpg no subo el recurso por que no tengo ni la menor idea que lua estará fallando (no hay errores) descargue esta version del spawn: https://community.multitheftauto.com/in ... ls&id=6429 Tambien tengo problema con este recurso, ase semanas me tira un monton de este error: este es el recurso: function destroyVehicle(vehicle) local check=false for i,player in ipairs(getElementsByType("player")) do if getPlayerOccupiedVehicle(player)==vehicle then check=true end end if check==false then destroyElement(vehicle) end end function exitVehicle(vehicle) setTimer(destroyVehicle,30000,1,vehicle) end addEventHandler("onPlayerVehicleExit",getRootElement(),exitVehicle) Ayudenme por favor D: Saludos
  23. Funciono al 100% Yo ya me estaba loqueando por que no me salia Tambien añadi para que no se pueda matar con cuchillo addEventHandler("onClientPlayerStealthKill", getRootElement(), function(targetPlayer) cancelEvent() end) Gracias!!!
  24. Hola a todos tengo un problema con el noteamkill ._. Descargue el Spawn 50p https://community.multitheftauto.com/in ... ls&id=6429 y edite el spawn_locations.map de ese script en friendlyfire="false" y nada no funciona el noteamkill tambien probe con scripts como estos y nada ( no dan error), solo funcionan cuando reinicio el recurso Ayudenme porfavor D: saludos
  25. Lo probe y da error en la linea 29, es por que al end le faltaba una coma. Le puse la coma que corresponde y me tira 2 errores, pero muy buen intento al hacer la base necesaria del script Este script funciona perfecto! es justo lo que necesitaba para que tire bien los stats cuando de login y avance un level Muchisimas gracias Muchas gracias a todos que me apoyaron a arreglar el script, son muy buenos todos se lo agradecere siempre. Doy este post como cerrado
×
×
  • Create New...