Jump to content

Stijger

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by Stijger

  1. Stijger

    God like car

    Hey SDK, This is what i got with your code. http://i.imgur.com/VcAcr.jpg and tried something of my own, being this: addEventHandler("onVehicleDamage", getRootElement(), cancelEvent ) and then i got this: http://i.imgur.com/JkEtQ.jpg Any ideas? cause i really just started with scripting, so don't know and get everything of it.
  2. Stijger

    God like car

    Hey SDK, thanks for your input, will test in a minute. And another question, how did you test or found out that race is overriding the function? (for my debugging methodes in the future)
  3. Stijger

    God like car

    like i said there is no error the text is displaying, but when i hit a wall or anything it still takes damage.
  4. Stijger

    God like car

    Hey Solidsnake14, Thanks for your reply, but the same thing happens the text is displaying fine but for some reason the vehicle is not made damageproof. In the debugscript there is also no error.
  5. Stijger

    God like car

    Hey guys, I am really new to the whole scripting thing, but really would like to use it. I got this script where the car in racemode would be undamageable. It works fine when I use the onClientMarkerHit handler, but i don't want that. function resource_starts () local vehicles = getElementsByType ( "vehicle" ) -- get a table of all the Vehicles in the server for theKey,theVehicle in ipairs(vehicles) do -- use a generic for loop to step through each vehicle if ( isVehicleOnGround ( theVehicle ) ) then -- if the vehicle is on the ground, announce it outputChatBox ( getVehicleName ( theVehicle ) .. " is on the ground and made GOD-like" ) setVehicleDamageProof ( theVehicle, true ) else -- if the vehicle isn't on the ground, announce that it is in the air outputChatBox ( getVehicleName ( theVehicle ) .. " is in the air and made GOD-like" ) setVehicleDamageProof ( theVehicle, true ) end end end addEventHandler ( "onClientMarkerHit", getRootElement(), resource_starts ) (sorry for the whole outputchatbox thingy, but just want to be sure the script is working) I would like to have it working at the start of the race. And so it seems cause the outputchatbox thing works, only the setVehicleDamageproof don't. function resource_starts () local vehicles = getElementsByType ( "vehicle" ) -- get a table of all the Vehicles in the server for theKey,theVehicle in ipairs(vehicles) do -- use a generic for loop to step through each vehicle if ( isVehicleOnGround ( theVehicle ) ) then -- if the vehicle is on the ground, announce it outputChatBox ( getVehicleName ( theVehicle ) .. " is on the ground and made GOD-like" ) setVehicleDamageProof ( theVehicle, true ) else -- if the vehicle isn't on the ground, announce that it is in the air outputChatBox ( getVehicleName ( theVehicle ) .. " is in the air and made GOD-like" ) setVehicleDamageProof ( theVehicle, true ) end end end addEventHandler ( "onClientResourceStart", getRootElement(), resource_starts ) and.. addEventHandler('onClientResourceStart', resourceRoot, function() local vehicles = getElementsByType ( "vehicle" ) -- get a table of all the Vehicles in the server for theKey,theVehicle in ipairs(vehicles) do -- use a generic for loop to step through each vehicle if ( isVehicleOnGround ( theVehicle ) ) then -- if the vehicle is on the ground, announce it outputChatBox ( getVehicleName ( theVehicle ) .. " is on the ground and made GOD-like" ) setVehicleDamageProof ( theVehicle, true ) else -- if the vehicle isn't on the ground, announce that it is in the air outputChatBox ( getVehicleName ( theVehicle ) .. " is in the air and made GOD-like" ) setVehicleDamageProof ( theVehicle, true ) end end end ) Any ideas what i am doing wrong? Many thanks in advance.
×
×
  • Create New...