Jump to content

Xwad

Members
  • Posts

    1,090
  • Joined

  • Last visited

Everything posted by Xwad

  1. Xwad

    setElementPosition

    One more question. I tryed it in server but its also not working there. debugscript: Bad argumentum @ 'getElementPosition' [expected element at argumentum 1,got nil] Bad argumentum @ 'setElementPosition' [expected element at argumentum 1,got nil] Bad argumentum @ 'setElementFrozen' [expected element at argumentum 1,got nil] server function onEnter () outputChatBox ( "Test" ) local x, y, z = getElementPosition(thePlayer) setElementPosition(thePlayer, -2422.1469, -607.8954, 132.56) setElementFrozen ( thePlayer, true ) end addEvent( "check", true ) addEventHandler( "check", resourceRoot, onEnter ) client function binds() bindKey ( "e", "down", onEnter ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), binds) function onEnter(posX, posY, posZ) triggerServerEvent ( "check", resourceRoot ) end
  2. Xwad

    setElementPosition

    its client sided. And its working thanks:D
  3. Hi i made this script that teleport the player to a given cordinates. But when i press f then the debug says this: WARNING: machineGun\client.lua:31: Bad argument @ 'setElementPosition' [Expected element at argument 1, got string 'f'] WARNING: machineGun\client.lua:30: Bad argument @ 'getElementPosition' [Expected element at argument 1, got string 'f'] function binds() bindKey ( "f", "down", onEnter ) end addEventHandler('onClientResourceStart', getRootElement(), binds) function onEnter ( localPlayer, posX, posY, posZ ) local x,y,z = getElementPosition(localPlayer) setElementPosition ( localPlayer, -2422.1469, -607.8954, 132.56 ) end
  4. Pls someone help:/ how can i create a txd for the converted dff file?
  5. i pressed "new" but there was no txd option.
  6. i cant create new txd for the dff:/ i cant open the dff file:/
  7. Hi i exported objects from call of duty 5 to obj and i want to convert it to txd,dff to use it in my mta server. Is this possible? Thanks.
  8. why is the bind key not working? The debugscript says that the setWeaponState has a bad argumentum. function createMachineGun(theWeapon, theState) local x, y, z = getElementPosition(getLocalPlayer()) local weapon = createWeapon("m4", x, y, z + 1) setWeaponClipAmmo(weapon, 100) setWeaponState(weapon, "ready") setWeaponFiringRate ( weapon , 30 ) end addEventHandler('onClientResourceStart', getRootElement(), createMachineGun) function binds() bindKey ( "mouse1", "down", fire_start ) bindKey ( "mouse1", "up", fire_stop ) end addEventHandler('onClientResourceStart', getRootElement(), binds) function fire_start(theWeapon, theState) setWeaponState(weapon, "firing") end function fire_stop(theWeapon, theState) setWeaponState(weapon, "ready") end
  9. Working! Thanks a lot again IIYAMA!
  10. so why is this triggerServerEvent not working? client triggerServerEvent("reload",localPlayer) server function reloadTimer( thePlayer ) outputChatBox ( "ddddddd" ) setTimer ( callbackMarkerHit, 4000, 1,thePlayer ) end addEvent( "reload", true ) addEventHandler( "reload", resourceRoot, reloadTimer )
  11. one more question. I want to make a timer for reloading. So add a triggerserver event when the bomb is armed.. So i replaced this in ObjClientBomber.lua (client side) script: To this self._fuseTimers[3] = triggerServerEvent ( "reload", resourceRoot, thePlayer ) From this self._fuseTimers[3] = setTimer(outputChatBox, 2500, 1, "* Bomb is armed!") and i added this to the server side script addEvent( "reload", true ) addEventHandler( "reload", resourceRoot, reloadTimer ) the problem is that its not triggering the serverside script:/
  12. Working! Thanks IIYAMA!)
  13. Hi! I downloaded this script for my server: https://community.multitheftauto.com/in ... ils&id=129 Its a very god script but i have a problem with it.. The bomb is only attaching to the plane if i hit the marker with the plane..And i wanted to make that the bomb will only be attached to the plane if a player enters it.. So i tryed to edit the script but its not working://I hope you can help me guys! original script (this is just a part of the script) function callbackMarkerHit(hitPlayer, matchingDimension) if (matchingDimension) then objBomber:callbackFunc("funcReloadBomber", hitPlayer) end end function callbackFunc(request, ...) objBomber:callbackFunc(request, source, arg[1]) end -- exports function regBombMarker(marker) addEventHandler("onMarkerHit", marker, callbackMarkerHit, false) end function regBombMarkers(markers) for _, marker in ipairs(markers) do addEventHandler("onMarkerHit", marker, callbackMarkerHit, false) end end function unregBombMarker(marker) removeEventHandler("onMarkerHit", marker, callbackMarkerHit) end function unregBombMarkers(markers) for _, marker in ipairs(markers) do removeEventHandler("onMarkerHit", marker, callbackMarkerHit) end end my edited script! (this is just a part of the script (bomber.lua).) function callbackMarkerHit(thePlayer) objBomber:callbackFunc("funcReloadBomber", thePlayer) end end function reloadTimer( thePlayer ) setTimer ( callbackMarkerHit, 5000, 1 ) end addEventHandler ( "onVehicleEnter", getRootElement(), reloadTimer )
  14. Xwad

    Help script

    Becaouse i also need commands for that function. And for that i need that argumentum. So why is the givePlayerMoney nkt working?
  15. Xwad

    Help script

    its server side
  16. Xwad

    Help script

    one more quesiton. Why is it not giving me the money? The script starts that function with a timer function captureAreaA1(commandName, player) local player = source or player UA1 = createRadarArea ( -2731.27, -2592, 250, 380, 255, 255, 31, alpha ) givePlayerMoney ( player, 1000 ) if isElement(markerG1) then destroyElement ( GA1 ) end end
  17. You can only add 1 skin to a vehicle.
  18. Its working now thanks!
  19. Yeah the spawn bot is in another resource. Well is good like that? call ( getResourceFromName ( "bot" ), botG4 = spawnBot ( -2632.10, -2408.71, 16.60,90, 17, 0, 0, teamG, 33, "guarding", true )
  20. Hi! My question is that why is it not spawning the bots when i start the captureAreaG1 function? Debugscript 3: ERROR: Attempt to call global 'spawnbot' (a nil value) function captureAreaG1(commandName, player) local teamG = getTeamFromName("German") GA1 = createRadarArea ( -2731.27, -2592, 250, 380, 40, 40, 40, alpha ) markerG1 = createMarker ( -2614.70, -2383.35, 14, "cylinder", 3, 255, 255, 0, 170 ) botG1 = spawnBot ( -2607.88, -2390.86, 17.35, 90, 17, 0, 0, teamG, 29, "guarding", true ) botG2 = spawnBot ( -2597.64, -2473.02, 19.22, 90, 17, 0, 0, teamG, 31, "guarding", true ) botG3 = spawnBot ( -2632.41, -2350.68, 12.76, 90, 17, 0, 0, teamG, 31, "guarding", true ) botG4 = spawnBot ( -2632.10, -2408.71, 16.60, 90, 17, 0, 0, teamG, 33, "guarding", true ) setElementHealth ( botG1, 40 ) setElementHealth ( botG2, 40 ) setElementHealth ( botG3, 40 ) setElementHealth ( botG4, 40 ) if isElement(markerA1) then destroyElement ( markerA1 ) destroyElement ( UA1 ) end end
×
×
  • Create New...