Jump to content

Klesh

Members
  • Posts

    306
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Klesh

  1. I was put the file to client, where is the bc command and the event, but in debugscript 3 shows bad argument, isPedInVehicle.
  2. Try this: myZombies = { } helmetzombies = { 167 } resourceRoot = getResourceRootElement() --FORCES ZOMBIES TO MOVE ALONG AFTER THEIR TARGET PLAYER DIES function playerdead () setTimer ( Zomb_release, 4000, 1 ) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), playerdead ) function Zomb_release () for k, ped in pairs( myZombies ) do if (isElement(ped)) then if (getElementData (ped, "zombie") == true) then setElementData ( ped, "target", nil ) setElementData ( ped, "status", "idle" ) table.remove(myZombies,k) end end end end --REMOVES A ZOMBIE FROM INFLUENCE AFTER ITS KILLED function pedkilled ( killer, weapon, bodypart ) if (getElementData (source, "zombie") == true) and (getElementData (source, "status") ~= "dead" ) then setElementData ( source, "target", nil ) setElementData ( source, "status", "dead" ) end end addEventHandler ( "onClientPedWasted", getRootElement(), pedkilled ) --THIS CHECKS ALL ZOMBIES EVERY SECOND TO SEE IF THEY ARE IN SIGHT function zombie_check () if (getElementData (getLocalPlayer (), "zombie") ~= true) and ( isPlayerDead ( getLocalPlayer () ) == false ) then local zombies = getElementsByType ( "ped",getRootElement(),true ) local Px,Py,Pz = getElementPosition( getLocalPlayer () ) if isPedDucked ( getLocalPlayer ()) then local Pz = Pz-1 end for theKey,theZomb in ipairs(zombies) do if (isElement(theZomb)) then local Zx,Zy,Zz = getElementPosition( theZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then if (getElementData (theZomb, "zombie") == true) then if ( getElementData ( theZomb, "status" ) == "idle" ) then --CHECKS IF AN IDLE ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == true) then setElementData ( theZomb, "status", "chasing" ) setElementData ( theZomb, "target", getLocalPlayer() ) table.insert( myZombies, theZomb ) --ADDS ZOMBIE TO PLAYERS COLLECTION table.remove( zombies, theKey) zombieradiusalert (theZomb) end elseif (getElementData(theZomb,"status") == "chasing") and (getElementData(theZomb,"target") == nil) then --CHECKS IF AN AGGRESSIVE LOST ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == true) then setElementData ( theZomb, "target", getLocalPlayer() ) isthere = "no" for k, ped in pairs( myZombies ) do if ped == theZomb then isthere = "yes" end end if isthere == "no" then table.insert( myZombies, theZomb ) --ADDS THE WAYWARD ZOMBIE TO THE PLAYERS COLLECTION table.remove( zombies, theKey) end end elseif ( getElementData ( theZomb, "target" ) == getLocalPlayer() ) then --CHECKS IF AN ALREADY AGGRESSIVE ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == false) then --IF YOUR ZOMBIE LOST YOU, MAKES IT REMEMBER YOUR LAST COORDS setElementData ( theZomb, "target", nil ) triggerServerEvent ("onZombieLostPlayer", theZomb, oldPx, oldPy, oldPz) end end end end end end --this second half is for checking peds and zombies local nonzombies = getElementsByType ( "ped",getRootElement(),true ) for theKey,theZomb in ipairs(zombies) do if (isElement(theZomb)) then if (getElementData (theZomb, "zombie") == true) then local Zx,Zy,Zz = getElementPosition( theZomb ) for theKey,theNonZomb in ipairs(nonzombies) do if (getElementData (theNonZomb, "zombie") ~= true) then -- if the ped isnt a zombie local Px,Py,Pz = getElementPosition( theNonZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false ) if (isclear == true) and ( getElementHealth ( theNonZomb ) > 0) then if ( getElementData ( theZomb, "status" ) == "idle" ) then --CHECKS IF AN IDLE ZOMBIE IS IN SIGHT triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "status", "chasing" ) setElementData ( theZomb, "target", theNonZomb ) zombieradiusalert (theZomb) elseif ( getElementData ( theZomb, "status" ) == "chasing" ) and ( getElementData ( theZomb, "target" ) == nil) then triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "target", theNonZomb ) end end end if ( getElementData ( theZomb, "target" ) == theNonZomb ) then --CHECKS IF AN ALREADY AGGRESSIVE ZOMBIE IS IN SIGHT OF THE PED local Px,Py,Pz = getElementPosition( theNonZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz+1, true, false, false, true, false, false, false) if (isclear == false) then --IF YOUR ZOMBIE LOST THE PED, MAKES IT REMEMBER the peds LAST COORDS triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "target", nil ) end end end end end end end end end for k, ped in pairs( myZombies ) do if (isElement(ped) == false) then table.remove( myZombies, k) end end oldPx,oldPy,oldPz = getElementPosition( getLocalPlayer () ) end --INITAL SETUP function clientsetupstarter(startedresource) if startedresource == getThisResource() then setTimer ( clientsetup, 1234, 1) MainClientTimer1 = setTimer ( zombie_check, 1000, 0) --STARTS THE TIMER TO CHECK FOR ZOMBIES end end addEventHandler("onClientResourceStart", getRootElement(), clientsetupstarter) function clientsetup() oldPx,oldPy,oldPz = getElementPosition( getLocalPlayer () ) throatcol = createColSphere ( 0, 0, 0, .3) woodpic = guiCreateStaticImage( .65, .06, .1, .12, "zombiewood.png", true ) guiSetVisible ( woodpic, false ) --ALL ZOMBIES STFU local zombies = getElementsByType ( "ped" ) for theKey,theZomb in ipairs(zombies) do if (isElement(theZomb)) then if (getElementData (theZomb, "zombie") == true) then setPedVoice(theZomb, "PED_TYPE_DISABLED") end end end --SKIN REPLACEMENTS local skin = engineLoadTXD ( "skins/13.txd" ) --bleedin eyes 31 by Slothman engineImportTXD ( skin, 13 ) local skin = engineLoadTXD ( "skins/22.txd" ) -- slashed 12 by Wall-E engineImportTXD ( skin, 22 ) local skin = engineLoadTXD ( "skins/56.txd" ) --young and blue by Slothman engineImportTXD ( skin, 56 ) local skin = engineLoadTXD ( "skins/67.txd" ) -- slit r* employee engineImportTXD ( skin, 67 ) local skin = engineLoadTXD ( "skins/68.txd" ) -- shredded preist by Deixell engineImportTXD ( skin, 68 ) local skin = engineLoadTXD ( "skins/69.txd" ) --bleedin eyes in denim by Capitanazop engineImportTXD ( skin, 69 ) local skin = engineLoadTXD ( "skins/70.txd" ) --ultra gory scientist by 50p engineImportTXD ( skin, 70 ) local skin = engineLoadTXD ( "skins/84.txd" ) --guitar wolf (nonzombie) by Slothman engineImportTXD ( skin, 84 ) local skin = engineLoadTXD ( "skins/92.txd" ) -- peeled flesh by xbost engineImportTXD ( skin, 92 ) local skin = engineLoadTXD ( "skins/97.txd" ) -- easterboy by Slothman engineImportTXD ( skin, 97 ) local skin = engineLoadTXD ( "skins/105.txd" ) --Scarred Grove Gangster by Wall-E engineImportTXD ( skin, 105 ) local skin = engineLoadTXD ( "skins/107.txd" ) --ripped and slashed grove by Wall-E engineImportTXD ( skin, 107 ) local skin = engineLoadTXD ( "skins/108.txd" ) -- skeleton thug by Deixell engineImportTXD ( skin, 108 ) local skin = engineLoadTXD ( "skins/111.txd" ) --Frank West from dead rising (nonzombie) by Slothman engineImportTXD ( skin, 111 ) local skin = engineLoadTXD ( "skins/126.txd" ) -- bullet ridden wiseguy by Slothman engineImportTXD ( skin, 126 ) local skin = engineLoadTXD ( "skins/127.txd" ) --flyboy from dawn of the dead by Slothman engineImportTXD ( skin, 127 ) local skin = engineLoadTXD ( "skins/128.txd" ) --holy native by Slothman engineImportTXD ( skin, 128 ) local skin = engineLoadTXD ( "skins/152.txd" ) --bitten schoolgirl by Slothman engineImportTXD ( skin, 152 ) local skin = engineLoadTXD ( "skins/162.txd" ) --shirtless redneck by Slothman engineImportTXD ( skin, 162 ) local skin = engineLoadTXD ( "skins/167.txd" ) --dead chickenman by 50p engineImportTXD ( skin, 167 ) local skin = engineLoadTXD ( "skins/188.txd" ) --burnt greenshirt by Slothman engineImportTXD ( skin, 188 ) local skin = engineLoadTXD ( "skins/192.txd" ) --Alice from resident evil (nonzombie) by Slothman engineImportTXD ( skin, 192 ) local skin = engineLoadTXD ( "skins/195.txd" ) --bloody ex by Slothman engineImportTXD ( skin, 195 ) local skin = engineLoadTXD ( "skins/206.txd" ) -- faceless zombie by Slothman engineImportTXD ( skin, 206 ) local skin = engineLoadTXD ( "skins/209.txd" ) --Noodle vendor by 50p engineImportTXD ( skin, 209 ) local skin = engineLoadTXD ( "skins/212.txd" ) --brainy hobo by Slothman engineImportTXD ( skin, 212 ) local skin = engineLoadTXD ( "skins/229.txd" ) --infected tourist by Slothman engineImportTXD ( skin, 229 ) local skin = engineLoadTXD ( "skins/230.txd" ) --will work for brains hobo by Slothman engineImportTXD ( skin, 230 ) local skin = engineLoadTXD ( "skins/258.txd" ) --bloody sided suburbanite by Slothman engineImportTXD ( skin, 258 ) local skin = engineLoadTXD ( "skins/264.txd" ) --scary clown by 50p engineImportTXD ( skin, 264 ) local skin = engineLoadTXD ( "skins/274.txd" ) --Ash Williams (nonzombie) by Slothman engineImportTXD ( skin, 274 ) local skin = engineLoadTXD ( "skins/277.txd" ) -- gutted firefighter by Wall-E engineImportTXD ( skin, 277 ) local skin = engineLoadTXD ( "skins/280.txd" ) --infected cop by Lordy engineImportTXD ( skin, 280 ) local skin = engineLoadTXD ( "skins/287.txd" ) --torn army by Deixell engineImportTXD ( skin, 287 ) end --UPDATES PLAYERS COUNT OF AGGRESIVE ZOMBIES addEventHandler ( "onClientElementDataChange", getRootElement(), function ( dataName ) if getElementType ( source ) == "ped" and dataName == "status" then local thestatus = (getElementData ( source, "status" )) if (thestatus == "idle") or (thestatus == "dead") then for k, ped in pairs( myZombies ) do if ped == source and (getElementData (ped, "zombie") == true) then setElementData ( ped, "target", nil ) table.remove( myZombies, k) setElementData ( getLocalPlayer(), "dangercount", tonumber(table.getn( myZombies )) ) end end end end end ) --MAKES A ZOMBIE JUMP addEvent( "Zomb_Jump", true ) function Zjump ( ped ) if (isElement(ped)) then setPedControlState( ped, "jump", true ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedControlState ( ped, "jump", false) end end, 800, 1, ped ) end end addEventHandler( "Zomb_Jump", getRootElement(), Zjump )
  3. Yes i know, i'm not blind what i mean is the color no load when the vehicle change, only that. PS: Thanks a lot for help me in this script. Im Just learning lua, you have wiki on your head.
  4. Color saves only when starts another map, but not when player takes a pickup. Now i see only was fixed: local r, g, b = unpack(fromJSON(color)) to local r, g, b = unpack(fromJSON(pcolor)) and addEventHandler("onVehicleEnter", getRootElement(), function (thePlayer) loadVehicleColor(thePlayer) end)
  5. What will be correct there then?
  6. I was try with that : function onPlayerLogin ( _, thePlayer, account, r, g, b ) local account = getPlayerAccount(thePlayer) local pColor = getAccountData(account, "color.data") if (pColor) then local color = getAccountData("color.data") local r, g, b = unpack(fromJSON(color)) triggerClientEvent(thePlayer,"colorv", thePlayer, "",r,g,b) if (color) then local playerVehicle = (getPedOccupiedVehicle(thePlayer) setVehicleColor(playerVehicle, tonumber(r), tonumber(g), tonumber(b), color) end end end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin) addEventHandler("onPlayerWasted", thePlayer, onPlayerLogin) addEventHandler("onPlayerPickUpRacePickUp", getRootElement, onPlayerLogin) addEventHandler("onVehicleEnter", thePlayer, onPlayerLogin) When player pickups a vehiclechange, the color purchased on bc command is not saving, or when playerjoins, what code is wrong.
  7. Now im trying to save that data, making a server-side with this: function onPlayerLogin ( _, thePlayer, account ) local account = getPlayerAccount(thePlayer) local pColor = getAccountData(account, "color.data") if (pColor) then local color = getAccountData("color.data") local r, g, b = unpack(fromJSON(color)) triggerClientEvent(thePlayer,"colorv", thePlayer, "",r,g,b) end end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin) addEventHandler("onPlayerWasted", getRootElement(), onPlayerLogin) addEvent("colorv", true) added in the other script, is the same of up of the topic. The question, what event handler i can add to get the color when the map is changing? and when the vehicle take the pickup vehicle change. Thanks for any help.
  8. Es posible, que los mapas que estas editando se estan guardando en el directorio diferente dentro del mta, la causa puede ser que no tengas actualizado tu mta, eso pasaba en el primer release del mtasa: 1.2, por lo que debes revisar este directorio, en windows xp español seria asi, \Archivos de programa\MTA San Andreas 1.2\server\mods\deathmatch\resources, revisa, alli debe estar tu mapa, pero como tu dices que estan bien, pues no te queda mas actualizar tu mta, o probando la version estable para windows o linux. Click aqui.
  9. Una pregunta, ¿estas editando tus mapas en tu servidor local o en tu map editor normal?
  10. Prueba este : addCommandHandler ( "agua", function ( thePlayer, command, level ) if level and tonumber ( level ) then setWaterLevel ( tonumber( level ) ) outputChatBox ( "El nivel del agua ahora es " .. level ) end end ) Es tipo servidor. <meta> <script src="agua.lua" type="server" /> </meta>
  11. Ese fue creado para ser usado en el samp ya que usan lenguaje pawno, vean el bar superior, buen post aunque el colorpicker sea para samp.
  12. Si se les da crash el mta que tienen porfavor lean este post, si no lo han entendido, se los dare traducido sacado del post by Towncivilian Post by Towncivilian el Dom 30 de enero 2011 12:26a.m. Si se bloquea el MTA en el arranque o durante la carga del juego, descargar y ejecutar MTADiag como administrador, a continuación, siga las instrucciones. Pega el archivo de registro generado en pastebin e incluir el vínculo en el tema de ayuda nueva. Si por alguna razón MTADiag no funciona, haga lo siguiente antes de crear un nuevo tema: Instale el parche más reciente de la MTA: SA Instala la última tiempos de ejecución de DirectX Si la instalación de los que no se soluciona el problema, trate de: Elimine el archivo gta_sa.set encuentra en los archivos de GTA San Andreas de usuario en los documentos de la carpeta / Library (Windows Vista y 7) o el directorio Mis Documentos (Windows XP) Revise en su directorio de instalación de GTA San Andreas para un d3d9.dll. Si uno está presente, elimínelo. Si todo lo anterior no resuelve su problema, tiene que iniciar un nuevo tema e incluir un registro de dxdiag de la siguiente manera: 1. Pulse la tecla de Windows R 2. Tipo dxdiag y pulse Intro, si un cuadro de diálogo emergente que le pedirá que compruebe la firma digital WHQL, haga clic en Sí. 3. Haga clic en Guardar toda la información ... 4. Incluir el contenido del registro guardado en el tema dentro de. También incluye cualquier mensaje de error que pueden aparecer cuando el MTA: SA accidentes, ya sea copiar y pegar el registro de bloqueo o una captura de pantalla está bien.
  13. MTA serial is number identification, like ip but the only diference its the serial is given by the mta application and can't not be changed, the serial was created to give a permanent number "id" , its imposible to change it, no matter how many time you unninstall your mta, always is the same serial.
  14. Do you mean that? outputConsole
  15. For what type of gamemode you want edit that, also you edit it in-game with admin panel on settings. You can call a vote with /vote /votemode /votemap.
  16. Primero que nada, necesitas crear tu propio shader o textura es decir .fx, luego tienes que remplazar o agregar funciones de cuando ejecutar el shader, como por ejemplo : addEventHandler("onClientResourceStart",resourceRoot, function() snowShader = dxCreateShader("shader.fx") end) Eso es un ejemplo basico de como comenzar hacer tus propias texturas como por ejemplo tu habias dicho la nieve, suerte! Para remplazar texturas normales con tus propios diseños puedes utilizar esto: txd = engineLoadTXD("files/admiral.txd") engineImportTXD(txd, 445) dff = engineLoadDFF("files/admiral.dff", 0) engineReplaceModel(dff, 445)
  17. Whell i see that little code and i fixed, but do you see it too, thanks.
  18. See old code, this one: local r, g, b = getVehicleColor(playerVehicle) and you put local r, g, b = getVehicleColor(thePlayer, true)
  19. Alredy fixed, you missed something, you set setVehicleColor(thePlayer, true), i changed to setVehicleColor(playerVehicle) but thanks.
  20. Error "Bad "vehicle" pointer @ getVehicleColor1()" The command executes good but the color doesnt set, badArgument setVehicleColor.
  21. Being no working, dont take money and dont setcolor. Error "expecteted near takeplayermoney".
  22. I was do this code, and is a buy command, the thing is dont set the vehicle color, it saves too. function colorHandler ( thePlayer, commandName, col1, col2, col3 ) if (playerVehicle) then playerVehicle = getPedOccupiedVehicle(thePlayer) account = getPlayerAccount(thePlayer) setAccountData("color.data", account) exCol1, exCol2, exCol3 = getVehicleColor(thePlayer) if not col1 then col1 = exCol1 end if not col2 then col2 = exCol2 end if not col3 then col3 = exCol3 end setVehicleColor(playerVehicle , col1, col2, col3) else outputChatBox("[Error]: You use /bc [color1 color2 color3]", thePlayer, 255,0 ,0, true) outputChatBox("You can use 3 colors with /bc command", thePlayer, 255, 0, 0, true) outputChatBox("[Error]: This command only works when the player is in the vehicle.", thePlayer, 255, 0, 0, true) end if (isPedInVehicle(thePlayer)) then if (getPlayerMoney(thePlayer) ~= 10000) takePlayerMoney(thePlayer, 10000) playSoundFrontEnd(thePlayer, 46) outputChatBox("#2E9AFE[shop]: #FFFFFF" ..getPlayerName(thePlayer).. "#2E9AFE has bought vehicle colors. (/bc)", root, 255, 255, 255, true) else outputChatBox("[Error]: You don't have enought money to buy.", thePlayer, 255, 0, 0, true) end else outputChatBox("[Error]: This command only works when the player is in the vehicle", thePlayer, 255, 0, 0, true) end end ) addCommnandHandler("bc", colorHandler)
  23. In the community can get one. Click here. This topic i think go to trash.
×
×
  • Create New...