Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. https://wiki.multitheftauto.com/wiki/GetPedTotalAmmo
  2. Actually, I don't use EDF, I never had to use it, sorry .
  3. onPickupUse is when you PICK a pickup. onPickupHit is when you HIT a pickup.
  4. Functions: setPedAnimation setTimer getElementHealth setElementHealth Commands: addCommandHandler
  5. local pushData = {[1] = "0.10", [2] = "0.20", [3] = "0.30"} function pushim (thePlayer, commandName, id, ...) player = findPlayer(...) if not player then outputChatBox("* /push: player not found", thePlayer) elseif isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) x,y,z = getElementVelocity(vehicle) local data = tonumber(pushData[tonumber(id)]) setElementVelocity ( vehicle, x, y, z+data) outputChatBox( getPlayerName(thePlayer).. " Push " ..getPlayerName(player), getRootElement(), 255, 255, 0, true) end end addCommandHandler("push", pushim)
  6. No, if i'm right, it won't give it as a weapon, so you could use it with your own function.
  7. You can create a new pickup with a custom function, to rotate it etc. I would suggest a colshape + the object of drug_green.
  8. Because that part is not there... function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) local x, y, z = getElementPosition ( source ) local health = createPickup ( x, y, z, 0, 40) addEventHandler("onPickupHit", health, givePlayerHealth) end addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) function givePlayerHealth(thePlayer) setElementHealth(thePlayer,tonumber(getElementHealth(thePlayer))+tonumber(getPickupAmount(source))) destroyElement(source) end Try it.
  9. Prices seems good, although, I don't know much about business of this kind . P.S: It says: "Pronze", shouldn't it be "Bronze" ?
  10. You want to create a pickup with player health? if so, try this: function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) local x, y, z = getElementPosition ( source ) local health = createPickup ( x, y, z, 0, 40) addEventHandler("onPickupHit", health, destroyPickup) end addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) function destroyPickup() destroyElement(source) end
  11. Gothem, todos los mods de vehiculos que suben son bajados de algun sitio, y con eso estan llenando la comunidad con mi****.
  12. addCommandHandler("sting", function(player) if (player) then local x, y, z = getElementPosition(player) local spike = createObject(2892,x+2,y+2,z-0.6) local x2, y2, z2 = getElementPosition(spike) local blow = createColSphere(x2, y2, z2, 3) addEventHandler("onColShapeHit",blow,function (player) if player and getElementType(player) == "player" then if isPedInVehicle(player) then local pveh = getPedOccupiedVehicle(player) setVehicleWheelStates(pveh,1,1,1,1) end end end) end end)
  13. function wb ( playerSource, command, targetPlayerName ) local playerWho = getPlayerFromName(targetPlayerName) if playerWho then local name = getPlayerName(playerWho) else name = targetPlayerName end outputChatBox ("<" .. getPlayerName (playerSource).."> Welcome Back, " ..tostring(name).." ! ",getRootElement (), 255, 255, 255, true) end addCommandHandler ( "wb", wb )
  14. Maybe it doesn't work because is "onTrailerAttach" not "onTrailerAtach"...? addEventHandler("onTrailerAttach",getRootElement(),function() cancelEvent() end)
  15. Jesse, the 'source' of onMarkerHit is the MARKER the player just hit.
  16. I think he meant this: function velocityArrow () for i,obj in ipairs (getElementsByType("object")) do local magnetMarker = createMarker ( 0, 0, 0, "cylinder", 3, 255, 255, 255, 255 ) if getElementModel(magnetObject) == 2846 then attachElements ( magnetMarker, obj, 0, 0, 0 ) end end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), velocityArrow)
  17. No hace falta comprimirlos, pueden quedarse como carpetas y seria igual, fijate bien que el 'meta.xml' del resource este bien.
  18. Castillo

    Problems

    Tried the last script I posted?
  19. Castillo

    Problems

    It's: 'resourceRoot' not 'resourceroot'.
  20. Castillo

    Problems

    addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() samsphere = createColSphere(208.21,1980.58,28.89,300) addEventHandler("onColShapeHit", samsphere, samFunction) addEventHandler("onColShapeLeave", samsphere, samLeaveFunction) samsphere1 = createColSphere(208.21,1980.58,28.89,1500) addEventHandler("onColShapeLeave", samsphere1, sam1LeaveFunction) warningsphere = createColSphere(208.21,1980.58,28.89,500) addEventHandler("onColShapeHit", warningsphere, warningFunction) addEventHandler("onColShapeLeave", warningsphere, warningLeaveFunction) samsite1 = createObject(3884,113.28,1814.28,32.45,0,0,309) samsite2 = createObject(3884,103.83,1901.12,32.45,0,0,309) samsite3 = createObject(3884,161.99,1933.18,32.45,0,0,145) samsite4 = createObject(3884,233.4,1934.85,32.45,0,0,145) samsite5 = createObject(3884,267.36,1895.48,32.45,0,0,145) samsite6 = createObject(3884,166.03,1850.09,32.45,0,0,350) samsite7 = createObject(3884,262.04,1807.5,32.45,0,0,37) end) function warningFunction(player) if (getElementType(player)) then local account = getPlayerAccount(player) local accountname = getAccountName(account) if getPlayerTeam(getTeamFromName("Military")) and isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Army" ) ) then outputChatBox("*RESTRICTED AREA*:Authorized to land at Area 69",player,0,0,255) else outputChatBox("*RESTRICTED AREA*:YOU ARE FLYING IN A NO FLY ZONE! TURN BACK!",255,0,0) end end end function samFunction(player) if (getElementType(player)) then if getPlayerTeam(getTeamFromName("Military")) and isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Army" ) ) then outputChatBox("*RESTRICTED AREA*: Third Check, Welcome Back. ",player,0,0,255) else outputChatBox("*RESTRICTED AREA*:YOU ARE STILL FLYING IN A NO FLY ZONE! YOU WILL BE SHOT DOWN!",255,0,0) addEventHandler("onClientRender",getRootElement(),fireMissiles) outputChatBox("WARNING: SAMS HAVE BEEN FIRED NOW!",player,255,0,0) end end end function warningLeaveFunction(player) if (getElementType(player)) then if getPlayerTeam(getTeamFromName("Military")) and isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Army" ) ) then outputChatBox("*RESTRICTED AREA*: BYE! ",player,0,0,255) else outputChatBox("*RESTRICTED AREA*:GOOD CHOICE!",255,0,0) end end end) function sam1LeaveFunction(player) if (getElementType(player)) then if (missiles == true) then removeEventHandler("onClientRender",getRootElement(),fireMissiles) missiles = false end end end function samLeaveFunction(player) if (getElementType(player)) then if getPlayerTeam(getTeamFromName("Military")) and isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Army" ) ) then outputChatBox("*RESTRICTED AREA*: GET THEM! ",player,0,0,255) else outputChatBox("*RESTRICTED AREA*: SOOOOOOOOOOOOOOO LUCKY!",255,0,0) end end end Try with that.
  21. Jaysd1, if you want to increase your post count, please don't do it here, you are confusing him, that's the same as I'd but moved the event handler before the function, which won't work.
×
×
  • Create New...