Jump to content

Scripting Water


Giovanni

Recommended Posts

Ye ye I know there are many topics about this but I can't really get this working. I checked the MTA Wiki for help but well that kind of failed.

I tried following 2 ways of creating/scripting water for MTA:

1. createWater

function thaResourceStarting( ) 
     
    createWater(4730,-1802.9077148438,224.25262451172,4730,-1790,224.25262451172,4705.8959960938,-1802.9077148438,224.25262451172,4705.8959960938,-1790,224.25262451172) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), thaResourceStarting) 

That script is placed server side. I wrote the coordinates in the right way I guess, so South-East after..... you know what I mean. Just like it is listed in the Wiki. Well nothing worked.

2. (?)

Somewhere I read about those tags. I really don't know how to use them. Also the Wiki didn't help me with this question. I just tried my luck and did this:

<water 4730,-1802.9077148438,224.25262451172,4730,-1790,224.25262451172,4705.8959960938,-1802.9077148438,224.25262451172,4705.8959960938,-1790,224.25262451172 /> 

I placed it in the meta.xml file, after that the map didn't work anymore, what I expected. So if you please could tell me how to use the tag. Thanks.

Link to comment
function thaResourceStarting( ) 
     
    createWater(4730,-1802.9077148438,224.25262451172,4730,-1790,224.25262451172,4705.8959960938,-1802.9077148438,224.25262451172,4705.8959960938,-1790,224.25262451172) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), thaResourceStarting) 

That script is placed server side.

if it is server-side, why are you using onClientResourceStart, which is client-side event?

as for XML — your syntax is totally wrong: https://wiki.multitheftauto.com/wiki/Water

Link to comment
function thaResourceStarting( ) 
     
    createWater(4730,-1802.9077148438,224.25262451172,4730,-1790,224.25262451172,4705.8959960938,-1802.9077148438,224.25262451172,4705.8959960938,-1790,224.25262451172) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), thaResourceStarting) 

That script is placed server side.

if it is server-side, why are you using onClientResourceStart, which is client-side event?

as for XML — your syntax is totally wrong: https://wiki.multitheftauto.com/wiki/Water

Well that was failure #1. I fixed it now but it still doesn't work.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...