Khtsjefen Posted April 4, 2012 Share Posted April 4, 2012 I'm trying to add water in an custom interior (it is in an own .map file), but I'm just getting bad argument at setElementDimenstion/Interior. Script is short, tried to add it as a function and so on already. local young = createWater( 267.58340454102, 101.59375, 1026.5515136719, 247.81484985352, 101.0810546875, 1026.5515136719, 247.84414672852, 111.6982421875, 1026.5440673828, 266.61758422852, 111.638671875, 1026.5515136719 ) setElementInterior( young, 6 ) setElementDimension( young, 9 ) Link to comment
Todd Posted April 4, 2012 Share Posted April 4, 2012 (edited) where function,handlers? function waterInt() local young = createWater( 267.58340454102, 101.59375, 1026.5515136719, 247.81484985352, 101.0810546875, 1026.5515136719, 247.84414672852, 111.6982421875, 1026.5440673828, 266.61758422852, 111.638671875, 1026.5515136719 ) setElementInterior( young, 6 ) setElementDimension( young, 9 ) end addEventHandler("onResourceStart",getRootElement(),waterInt) it has to be .lua file cause you can't add "function" to .map file Edited April 4, 2012 by Guest Link to comment
Renkon Posted April 4, 2012 Share Posted April 4, 2012 Water will be invisible at interiors unluckily. But there's some object that looks like water, and you can "try" to make it look like it were real water. But actually, there's no way to have visible water. Only invisbile. You would be swimming like if you were flying Link to comment
Todd Posted April 4, 2012 Share Posted April 4, 2012 Water will be invisible at interiors unluckily.But there's some object that looks like water, and you can "try" to make it look like it were real water. But actually, there's no way to have visible water. Only invisbile. You would be swimming like if you were flying if it's true I think that make water is possible but you have to write it. Here is my idea( I don't think that is good ): 1. make object like water 2. set it non collidable 3. make function if player will be under object then create dx effect or show blue transparent image.( underwater visual effect) 4. make player fly if he is under that object. Link to comment
Khtsjefen Posted April 4, 2012 Author Share Posted April 4, 2012 A: Nop, todd. No water, not visible, not invisible. Getting: [2012-04-04 22:19:24] WARNING: [rp]\map-system\custom\young.lua:3: Bad argument @ 'setElementInterior' [2012-04-04 22:19:24] WARNING: [rp]\map-system\custom\young.lua:4: Bad argument @ 'setElementDimension' still. B: The visibillity is no problem, but I am not even getting invisible. I will spawn the water object later. C: Wrote this before Todd's last post: I am not such a good scripter. Link to comment
Renkon Posted April 4, 2012 Share Posted April 4, 2012 addEventHandler("onResourceStart",getRootElement(),function() local young = createWater( 267.58340454102, 101.59375, 1026.5515136719, 247.81484985352, 101.0810546875, 1026.5515136719, 247.84414672852, 111.6982421875, 1026.5440673828, 266.61758422852, 111.638671875, 1026.5515136719 ) if young then setElementInterior( young, 6 ) setElementDimension( young, 9 ) else outputChatBox("error at creating water", 255, 255, 255, true) end end) Link to comment
Khtsjefen Posted April 4, 2012 Author Share Posted April 4, 2012 Nop Renkon Getting your nice little error. Possibly something wrong with the MTA's water function, or? I have tried .map tags to make it too. Link to comment
Renkon Posted April 4, 2012 Share Posted April 4, 2012 Then it means that "young" object isn't created correctly. We are going straight to fix the problem. Try this: addEventHandler("onResourceStart",getRootElement(),function() local young = createWater( 247.81484985352, 101.0810546875, 1026.5515136719, 267.58340454102, 101.59375, 1026.5515136719, 247.84414672852, 111.6982421875, 1026.5440673828, 266.61758422852, 111.638671875, 1026.5515136719 ) if young then setElementInterior( young, 6 ) setElementDimension( young, 9 ) else outputChatBox("error at creating water", 255, 255, 255, true) end end) Tell me whether it works or not again. Thanks Link to comment
Khtsjefen Posted April 4, 2012 Author Share Posted April 4, 2012 Finally a place to swim! Ty Link to comment
Renkon Posted April 4, 2012 Share Posted April 4, 2012 Finally a place to swim! Ty No Problem Remember that do make a Water quadrant you have to add, first, SW, then SE, then NW and finally NE by coordinates. That's why it wasn't working. Link to comment
drk Posted April 4, 2012 Share Posted April 4, 2012 where function,handlers? function waterInt() local young = createWater( 267.58340454102, 101.59375, 1026.5515136719, 247.81484985352, 101.0810546875, 1026.5515136719, 247.84414672852, 111.6982421875, 1026.5440673828, 266.61758422852, 111.638671875, 1026.5515136719 ) setElementInterior( young, 6 ) setElementDimension( young, 9 ) end addEventHandler("onResourceStart",getRootElement(),waterInt) it has to be .lua file cause you can't add "function" to .map file Functions and handlers aren't needed, all things out of functions are executed when resource starts Link to comment
Khtsjefen Posted April 5, 2012 Author Share Posted April 5, 2012 Finally a place to swim! Ty No Problem Remember that do make a Water quadrant you have to add, first, SW, then SE, then NW and finally NE by coordinates. That's why it wasn't working. Okay, the wiki should be a bit more clear on that then. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now