Jump to content

KaMi

Members
  • Posts

    155
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by KaMi

  1. Usa onClientMarkerHit onClientMarkerLeave dxDrawImage
  2. The zone disappears. This maybe happens because you spam the 'fireon' command. I did use an element detector for u can verify if this deduction is right. Or maybe can use 'showcol 1' command. local zones = {} local Fogo = {} function GrHabilit(Elemento) if Elemento and getElementData(source,"colGr") then if getElementModel(Elemento) ~= 78 then if getElementType(Elemento) == "player" or getElementType(Elemento) == "ped" then setPedOnFire(Elemento,true) elseif getElementType(Elemento) == "vehicle" then --this to not blow his bike XD setElementHealth( Elemento, 200 ) end end end end addEventHandler("onColShapeHit",getRootElement(),GrHabilit) function fireon (thePlayer) if getElementModel(thePlayer) == 78 then if not isElement(Fogo[thePlayer]) then local x, y, z = getElementPosition (thePlayer) Fogo[thePlayer] = createObject( ObjectID, x, y, z )-- PUT HERE YOUR OBJECT ID ( objectID ). setElementCollisionsEnabled(Fogo[thePlayer], false) exports.bone_attach:attachElementToBone (Fogo[thePlayer], thePlayer, 8, -0, 0, -0.3, -125, 0, 0) setElementAlpha( Fogo[thePlayer], 0 ) zones[thePlayer] = createColCuboid(x, y, z, 3.1827392578125, 3.8387451171875, 2.4195971488953) attachElements(zones[thePlayer],thePlayer,0,0,0) setElementData(zones[thePlayer],"colGr",true) -- to burn who ever get near him outputChatBox ( "#FFFF00Power #00FF00Revenge Fire ON", thePlayer, 0, 255, 0, true ) else destroyElement(Fogo[thePlayer]) destroyElement(zones[thePlayer]) setTimer( fireon, 100, 1, thePlayer ) end end end addCommandHandler ("fireon", fireon) function fireoff (player) if getElementModel(player) == 78 then if isElement(zones[thePlayer]) then -- check if player has burn zone destroyElement ( zones[player] ) -- destroy the burn zone destroyElement(Fogo[player]) --destroy the fire shape outputChatBox ( "#FFFF00Power #00FF00Revenge Fire OFF", player, 0, 255, 0, true ) end end end addCommandHandler ("fireoff", fireoff)
  3. local zones = {} local Fogo = {} function GrHabilit(Elemento) if Elemento and getElementData(source,"colGr") then if getElementModel(Elemento) ~= 78 then if getElementType(Elemento) == "player" or getElementType(Elemento) == "ped" then setPedOnFire(Elemento,true) elseif getElementType(Elemento) == "vehicle" then --this to not blow his bike XD setElementHealth( Elemento, 200 ) setTimer( setVehicleDamageProof, 100, 1, Elemento, true ) end end end end addEventHandler("onColShapeHit",getRootElement(),GrHabilit) function fireon (thePlayer) if getElementModel(thePlayer) == 78 then local x, y, z = getElementPosition (thePlayer) Fogo[thePlayer] = createObject( ObjectID, x, y, z )-- PUT HERE YOUR OBJECT ID ( objectID ). setElementCollisionsEnabled(Fogo[thePlayer], false) exports.bone_attach:attachElementToBone (Fogo[thePlayer], thePlayer, 8, -0, 0, -0.3, -125, 0, 0) setElementAlpha( Fogo[thePlayer], 0 ) zones[thePlayer] = createColCuboid(x, y, z, 3.1827392578125, 3.8387451171875, 2.4195971488953) attachElements(zones[thePlayer],thePlayer,0,0,0) setElementData(zones[thePlayer],"colGr",true) -- to burn who ever get near him outputChatBox ( "#FFFF00Power #00FF00Revenge Fire ON", thePlayer, 0, 255, 0, true ) end end addCommandHandler ("fireon", fireon) function fireoff (player) if getElementModel(player) == 78 then if ( zones[player] ~= false ) then -- check if player has burn zone destroyElement ( zones[player] ) -- destroy the burn zone destroyElement(Fogo[player]) --destroy the fire shape outputChatBox ( "#FFFF00Power #00FF00Revenge Fire OFF", player, 0, 255, 0, true ) end end end addCommandHandler ("fireoff", fireoff)
  4. That only works if you write " /ss 152 ". It's not programmed for every skin. It's only an example
  5. use onElementModelChange and setPedWalkingStyle this is an example function changeWalkingStyle(oldModel,newModel) if ( getElementType(source) == "player" ) then if ( newModel == 152 ) then setPedWalkingStyle( source, 133 ) end end end addEventHandler("onElementModelChange", root, changeWalkingStyle)
  6. I'm sorry for bothering but I'm very confused. What can I do?
  7. I put the code in this form, but nothing if not objectTable then objectTable = {}; end objectTable[playerSource] = createObject(2976,0,0,0) function setObjectInWeapon( previousWeaponID, currentWeaponID ) if (getElementData (source, "Armactivada") == true) then if ( currentWeaponID == 31 ) then exports.bone_attach:attachElementToBone(objectTable[playerSource],source,12,-0.09,0,-0.03,0,2,40) elseif ( previousWeaponID == 31 ) then exports.bone_attach:detachElementFromBone( objectTable[playerSource] ) destroyElement( objectTable[playerSource] ) end end end addEventHandler("onPlayerWeaponSwitch", root, setObjectInWeapon) function wast() if (getElementData (source, "Armactivada") == true) then destroyElement( objectTable[playerSource] ) end end addEventHandler("onPlayerWasted", root, wast) if isElement(objectTable[playerSource]) then detachElements(objectTable[playerSource]) destroyElement(objectTable[playerSource]) end the console give me this error : ERROR: Weap\server.lua:24 table index is nil SERVER-SIDE if not objectTable then objectTable = {}; end objectTable[playerSource] = createObject(2976,0,0,0) function setObjectInWeapon( previousWeaponID, currentWeaponID ) if (getElementData (source, "Armactivada") == true) then if ( currentWeaponID == 31 ) then exports.bone_attach:attachElementToBone(objectTable[playerSource],source,12,-0.09,0,-0.03,0,2,40) elseif ( previousWeaponID == 31 ) then exports.bone_attach:detachElementFromBone( objectTable[playerSource] ) destroyElement( objectTable[playerSource] ) end end end addEventHandler("onPlayerWeaponSwitch", root, setObjectInWeapon) function wast() if (getElementData (source, "Armactivada") == true) then destroyElement( objectTable[playerSource] ) end end addEventHandler("onPlayerWasted", root, wast) if isElement(objectTable[playerSource]) then detachElements(objectTable[playerSource]) destroyElement(objectTable[playerSource]) end CLIENT-SIDE function fireGG_135( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement, startX, startY, startZ ) if (getElementData (source, "Armactivada") == true) then if ( weapon == 31 ) then local genergy = createMarker( 0, 0, 0, "corona", 1, 0, 165, 57, 255 ) local genergyo = createObject( 2976, startX, startY, startZ ) setElementAlpha( genergyo, 0 ) attachElements( genergy, genergyo, 0, 0, 0 ) moveObject( genergyo, 1000, hitX, hitY, hitZ ) setElementCollisionsEnabled( genergyo, false ) setTimer( function() destroyElement( genergyo ) destroyElement( genergy ) createExplosion( hitX, hitY, hitZ, 2 ) end, 1500, 1 ) end end end addEventHandler("onClientPlayerWeaponFire", root, fireGG_135)
  8. i forget specify this frascote[source] = frasco answering your question... i think in the line 13. I don't usually use tables
  9. thanks, can you pls give an example ? my mind is blank
  10. Hello ! I recently made a weapon that shoots explosives. I thought about adding an object in the form of decoration using the bone attach resource. Everything go well until I realized that , when the player dies, the object stayed stuck and was not destroyed. Here you have the code function activArmas( player ) if (getElementData (player, "Armactivada") == false) then setElementData (player, "Armactivada", true) outputChatBox( "Activaste el arma", player, 100, 0, 0 ) else setElementData (player, "Armactivada", false) outputChatBox( "Desactivaste el arma", player, 100, 0, 0 ) end end addCommandHandler("activar", activArmas) local frascote = {} function setObjectInWeapon( previousWeaponID, currentWeaponID ) if (getElementData (source, "Armactivada") == true) then if ( currentWeaponID == 31 ) then exports.bone_attach:attachElementToBone(frascote[source],source,12,-0.09,0,-0.03,0,2,40) elseif ( previousWeaponID == 31 ) then exports.bone_attach:detachElementFromBone( frascote[source] ) destroyElement( frascote[source] ) end end end addEventHandler("onPlayerWeaponSwitch", root, setObjectInWeapon) function wast() if (getElementData (source, "Armactivada") == true) then destroyElement( frascote[source] ) --Here i have my problem. end end addEventHandler("onPlayerWasted", root, wast) Sorry for repost the topic but the spanish community is not than active . Thanks a lot !
  11. ¡ Hola ! hace poco hice un arma que dispara explosivos. Pensé en agregarle un objeto en forma de decoración usando el resource bone attach. Todo fue bien hasta que me di cuenta que, cuando el jugador moría, el objeto se quedaba pegado y no se destruía. Acá tienen el código function activArmas( player ) if (getElementData (player, "Armactivada") == false) then setElementData (player, "Armactivada", true) outputChatBox( "Activaste el arma", player, 100, 0, 0 ) else setElementData (player, "Armactivada", false) outputChatBox( "Desactivaste el arma", player, 100, 0, 0 ) end end addCommandHandler("activar", activArmas) local frascote = {} function setObjectInWeapon( previousWeaponID, currentWeaponID ) if (getElementData (source, "Armactivada") == true) then if ( currentWeaponID == 31 ) then exports.bone_attach:attachElementToBone(frascote[source],source,12,-0.09,0,-0.03,0,2,40) elseif ( previousWeaponID == 31 ) then exports.bone_attach:detachElementFromBone( frascote[source] ) destroyElement( frascote[source] ) end end end addEventHandler("onPlayerWeaponSwitch", root, setObjectInWeapon) function wast() if (getElementData (source, "Armactivada") == true) then destroyElement( frascote[source] ) --Acá es donde tengo mi duda. end end addEventHandler("onPlayerWasted", root, wast) Muchas gracias
  12. That is a really good idea. I'm sure they'll make this editor become official. I have some ideas for this : * Add water. *Add a translator with the most used languages (such as Spanish, Russian, Portuguese, Arabic, etc.) - I say it because that GUI looks complex. *Add a " stacker " like in this game ( going to help too much mappers ) *if you are based on the code of the original editor, please solve this horrible problem: " test could not be started! cannot begin test while a save or load is in progress " because much people is reporting that error. Thanks for read ! ( if you can't understand something i said, i'm sorry... my original language is the Spanish ) PD : maybe i repeat some idea, i'm sorry again, i'm very clueless Good luck.
×
×
  • Create New...