DhrJay Posted December 18, 2012 Share Posted December 18, 2012 Hii All! I was working with the bank script today when i noticed that when you entered the bank in LS you exit in LV... I already deleted the normal markers, and added them with the teleport_editor... But now when you go to dim. 4, there is no bank... I need to know how to add dimentions to the '' LV Main Bank'' in the bank script.... This is the script: <banks> <bank name="Western Onion" blip="true"> <location posX="361.8298" posY="173.6187" posZ="1008.3828" ATM="false" ATMRot="0.0" interior="3" /> </bank> <bank name="LV Main Bank" blip="true"> <location posX="361.8298" posY="173.6187" posZ="1008.3828" ATM="false" ATMRot="0.0" interior="3" /> </bank> <bank name="Western Onion ATM #1" blip="false" depositAllowed="true" > <location posX="360.07577514648" posY="188.58430175781" posZ="1008.3828125" ATM="true" interior="3" ATMRot="0.0" markerSize="1" /> </bank> <bank name="Western Onion ATM #2" blip="false" depositAllowed="true" ATMInterior="3" > <location posX="364.07577514648" posY="188.58430175781" posZ="1008.3828125" ATM="true" interior="3" ATMRot="0.0" markerSize="1" /> </bank> <bank name="Western Onion ATM #3" ATMInterior="3" > <location posX="2630.6667480469" posY="1655.393046875" posZ="11.0234375" ATM="true" interior="0" ATMRot="180.0" markerSize="1" /> </bank> <bank name="The Clowns ATM 1" blip="false" depositAllowed="true" > <location posX="2224.0856933594" posY="1831.5157470703" posZ="10.8203125" ATM="true" interior="0" ATMRot="90" markerSize="1" /> </bank> <bank name="Club Infected ATM" ATMInterior="3" > <location posX="-2654.9677734375" posY="1373.2547607422" posZ="7.0987930297852" ATM="true" interior="0" ATMRot="180.0" markerSize="1" /> </bank> </banks> Thanks! -Jay Link to comment
manve1 Posted December 18, 2012 Share Posted December 18, 2012 (edited) you must make a function that would handle the dimensions in the script and would load it from the xml file Edited December 18, 2012 by Guest Link to comment
Castillo Posted December 18, 2012 Share Posted December 18, 2012 That script doesn't has dimension support if I'm right, you need to add it by yourself to the script. Link to comment
DhrJay Posted December 18, 2012 Author Share Posted December 18, 2012 That script doesn't has dimension support if I'm right, you need to add it by yourself to the script. Deamn Solidsnake...! You replayd on one of my forums many years agooo...! You are an MTA Veteran... Could you tell me how to script this? Smiles, Jay Link to comment
Castillo Posted December 18, 2012 Share Posted December 18, 2012 Replace: bank.xml.server.lua with this: --[[ Resource: bank (written by 50p) Version: 2.3 Filename: bank.xml.server.lua ]] bankSQLInfo = { } banksInfo = { } function bankInit( ) local useATMs = get( "bank.useATMs" ) local xml_root = xmlLoadFile( "bank.locations.xml" ) local banks = 0 while( xmlFindChild( xml_root, "bank", banks ) ) do local markerSize local tempID = banks+1 banksInfo[ tempID ] = { } local bank_node = xmlFindChild( xml_root, "bank", banks ) banksInfo[ tempID ].name = xmlNodeGetAttribute( bank_node, "name" ) banksInfo[ tempID ].useBlip = xmlNodeGetAttribute( bank_node, "blip" ) or true banksInfo[ tempID ].depositAllowed = xmlNodeGetAttribute( bank_node, "depositAllowed" ) or true local bank_loc = xmlFindChild( bank_node, "location", 0 ) banksInfo[ tempID ].posX = tonumber( xmlNodeGetAttribute( bank_loc, "posX" ) ) banksInfo[ tempID ].posY = tonumber( xmlNodeGetAttribute( bank_loc, "posY" ) ) banksInfo[ tempID ].posZ = tonumber( xmlNodeGetAttribute( bank_loc, "posZ" ) ) banksInfo[ tempID ].interior = tonumber( xmlNodeGetAttribute( bank_loc, "interior" ) ) or 0; banksInfo[ tempID ].dimension = tonumber( xmlNodeGetAttribute( bank_loc, "dimension" ) ) or 0; markerSize = tonumber( xmlNodeGetAttribute( bank_loc, "markerSize" ) ) or 2 banksInfo[ tempID ].marker = createMarker( banksInfo[ tempID ].posX, banksInfo[ tempID ].posY, banksInfo[ tempID ].posZ-.9, "cylinder", markerSize, 250, 0, 0, 100 ) setElementInterior( banksInfo[ tempID ].marker, banksInfo[ tempID ].interior ); if banksInfo[ tempID ].dimension then setElementDimension( banksInfo[ tempID ].marker, banksInfo[ tempID ].dimension ); end if useATMs and xmlNodeGetAttribute( bank_loc, "ATM" ) == "true" then local rot = tonumber( xmlNodeGetAttribute( bank_loc, "ATMRot" ) ) or 0.0 local x, y, z = banksInfo[ tempID ].posX, banksInfo[ tempID ].posY, banksInfo[ tempID ].posZ x = x + math.sin( math.rad( rot ) ) * .6 y = y + math.cos( math.rad( rot ) ) * .6 banksInfo[ tempID ].ATM = createObject( 2942, x, y, z-.35, 0, 0, (360-rot) ) setElementInterior( banksInfo[ tempID ].ATM, tonumber( xmlNodeGetAttribute( bank_loc, "interior" ) ) or 0 ) setElementParent( banksInfo[ tempID ].ATM, banksInfo[ tempID ].marker ) end if xmlFindChild( bank_node, "entrance", 0 ) then banksInfo[ tempID ].entrance = { } local entrance_node = xmlFindChild( bank_node, "entrance", 0 ) banksInfo[ tempID ].entrance.posX = xmlNodeGetAttribute( entrance_node, "posX" ) banksInfo[ tempID ].entrance.posY = xmlNodeGetAttribute( entrance_node, "posY" ) banksInfo[ tempID ].entrance.posZ = xmlNodeGetAttribute( entrance_node, "posZ" ) banksInfo[ tempID ].entrance.interior = tonumber( xmlNodeGetAttribute( entrance_node, "interior" ) ) or 0; banksInfo[ tempID ].entrance.teleX = xmlNodeGetAttribute( entrance_node, "teleX" ) banksInfo[ tempID ].entrance.teleY = xmlNodeGetAttribute( entrance_node, "teleY" ) banksInfo[ tempID ].entrance.teleZ = xmlNodeGetAttribute( entrance_node, "teleZ" ) banksInfo[ tempID ].entrance.teleRot = xmlNodeGetAttribute( entrance_node, "teleRot" ) banksInfo[ tempID ].entrance.teleInterior = xmlNodeGetAttribute( entrance_node, "teleInterior" ) banksInfo[ tempID ].entrance.teleDimension = tonumber(xmlNodeGetAttribute( entrance_node, "teleDimension" )) or 0; banksInfo[ tempID ].entrance.marker = createMarker( banksInfo[ tempID ].entrance.posX, banksInfo[ tempID ].entrance.posY, banksInfo[ tempID ].entrance.posZ-1, "cylinder", 1.5, 250, 250, 0, 100 ) local blip = createBlipAttachedTo( banksInfo[ tempID ].entrance.marker, 52, 1, 255, 0, 0, 255, 0, 250); local col = createColTube( banksInfo[ tempID ].entrance.posX, banksInfo[ tempID ].entrance.posY, banksInfo[ tempID ].entrance.posZ-180, 150, 360 ) setElementParent( banksInfo[ tempID ].entrance.marker, col ) setElementInterior( banksInfo[ tempID ].entrance.marker, banksInfo[ tempID ].entrance.interior ); elseif ( type( banksInfo[ tempID ].useBlip ) == "boolean" and banksInfo[ tempID ].useBlip == true ) or ( type( banksInfo[ tempID ].useBlip ) == "string" and banksInfo[ tempID ].useBlip == "true" ) then local col = createColTube( banksInfo[ tempID ].posX, banksInfo[ tempID ].posY, banksInfo[ tempID ].posZ-180, 150, 360 ) setElementParent( banksInfo[ tempID ].marker, col ) end if xmlFindChild( bank_node, "exit", 0 ) and banksInfo[ tempID ].entrance then banksInfo[ tempID ]._exit = { } local exit_node = xmlFindChild( bank_node, "exit", 0 ) banksInfo[ tempID ]._exit.posX = xmlNodeGetAttribute( exit_node, "posX" ) banksInfo[ tempID ]._exit.posY = xmlNodeGetAttribute( exit_node, "posY" ) banksInfo[ tempID ]._exit.posZ = xmlNodeGetAttribute( exit_node, "posZ" ) banksInfo[ tempID ]._exit.interior = tonumber( xmlNodeGetAttribute( exit_node, "interior" ) ) or 0; banksInfo[ tempID ]._exit.teleX = xmlNodeGetAttribute( exit_node, "teleX" ) banksInfo[ tempID ]._exit.teleY = xmlNodeGetAttribute( exit_node, "teleY" ) banksInfo[ tempID ]._exit.teleZ = xmlNodeGetAttribute( exit_node, "teleZ" ) banksInfo[ tempID ]._exit.teleRot = xmlNodeGetAttribute( exit_node, "teleRot" ) banksInfo[ tempID ]._exit.teleInterior = xmlNodeGetAttribute( exit_node, "teleInterior" ) banksInfo[ tempID ]._exit.teleDimension = xmlNodeGetAttribute( exit_node, "teleDimension" ) banksInfo[ tempID ]._exit.dimension = xmlNodeGetAttribute( exit_node, "dimension" ) banksInfo[ tempID ]._exit.marker = createMarker( banksInfo[ tempID ]._exit.posX, banksInfo[ tempID ]._exit.posY, banksInfo[ tempID ]._exit.posZ-1, "cylinder", 1.5, 250, 250, 0, 100 ) setElementInterior( banksInfo[ tempID ]._exit.marker, banksInfo[ tempID ]._exit.interior ); if banksInfo[ tempID ]._exit.dimension then setElementDimension( banksInfo[ tempID ]._exit.marker, banksInfo[ tempID ]._exit.dimension ); end end banks = banks + 1 end bankSQLInfo.tab = get( "bank.SQLTable" ) bankSQLInfo.username = get( "bank.SQLUserNameField" ) bankSQLInfo.balance = get( "bank.SQLMoneyField" ) if not bankSQLInfo.tab then bankSQLInfo.tab = "bank_accounts" end if not bankSQLInfo.username then bankSQLInfo.username = "username" end if not bankSQLInfo.balance then bankSQLInfo.balance = "balance" end end Then just add 'dimension' attribute when you are creating the bank with the dimension you want it to appear at. Link to comment
DhrJay Posted December 18, 2012 Author Share Posted December 18, 2012 OMG! Tnkx man! It worked! You're awesome! Tnkx, Tnkx, Tnkx! 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