Jump to content

Stylez

Members
  • Posts

    85
  • Joined

  • Last visited

Posts posted by Stylez

  1. Hi guys. i made this script but it has 2 errors in debug.

    [2012-03-28 17:52:27] WARNING: automobiliai\automobiliai.lua:20: Bad 'vehicle' pointer @ 'getVehicleOccupant'(1)

    [2012-03-28 17:52:27] WARNING: automobiliai\automobiliai.lua:21: Bad 'vehicle' pointer @ 'getVehicleOccupant'(1)

    BTW. script works fine :?

    function engine(driver) 
        local vehicleHealth = getElementHealth(source) 
        if vehicleHealth <= 500 then 
            setVehicleEngineState(source, false) 
            getVehicleOccupant(driver) 
            outputChatBox("((Your engine is broken!))", getVehicleOccupant(driver), 255, 204,0) 
        end 
    end 
    addEventHandler("onVehicleEnter", getRootElement(), engine) 
      
    

  2. mhm i know that, i thought that its possible to do that IG. by the way, im making DM map, so there is allots of object's in .map file :/

  3. Yes, because you not use argument in timer.

    Also bad idea add event handler in timer :/

    And i not understand why you need timer.

    Maybe you need if vehicle explode it destroyed in next seconds?

      
    function fExplode ( ) 
            setTimer( destroyElement, 5000, 1, source ) 
    end 
    addEventHandler( 'onVehicleExplode', root, fExplode ) 
      
    

    You mean it?

    yes thats what i meant. thankyou. :]

  4. Hey everybody. i am newbie in MTA scripting, but i badly wanna learn it and after few weeks of reading wiki. i tried to make my own script.

    which will delete the blown cars.

    i managed to make it so far :arrowdown: (serverSide)

    function refresh (theVehicle) 
    local vehicles = getElementsByType("Vehicle") 
        if isVehicleBlown(theVehicle) then 
            destroyElement(vehicles) 
        end 
    end 
    addEventHandler("onVehicleExplode", getRootElement(), refresh) 
    setTimer(refresh, 5000, 0) 
    

    but when i run it. it shows errors in debug "Bad argument @ isVehicleBlown" :/

    sry, for my english :]

×
×
  • Create New...