Guest Posted September 6, 2008 Share Posted September 6, 2008 hey everyone, first i would like to take a chance to say how great multitheftauto is, Im from the uk, and ive been running a lan server for 3-4 weeks now, its proving very popular with my friends. we play regualry about twice a week. with from 6-8 players. The gameplay is fantasticaly fun, and i have been trying to add some extra feature to the server and learn a little scripting along the way. The server is a freeroam do anything kind of gamemode, most of its features are extended versions of scripts from the great resource page. i have however made a few of my own. i would say im still very much a begginer at scripting and still trying to grasp all the basics. Rather than create two topics i decided to put both of my scripting questions here, i hope thats alright ? ive been trying to get house icons appear on the radar when you are near buyable propertys. to create the propertys im using https://community.multitheftauto.com/index.php?p=resources&s=details&id=140 to create the radar blips i decided to take alook at the Vblips script and customise it, However my results were not entierly sucessfull. House blips now appear on the radar. and appear when u are close and dissapear when u are far. but they appear over every pickup item (health money house ) i think i need to add some kind of check to check the pickup type. but im just getting confused. if anyone could help out it would be muchly apriciated. here is the House blips code. addEventHandler( "onClientElementStreamIn", getRootElement(), function() if getElementType( source ) == "pickup" then if ( id[source] ) then aHouseBlip = createBlipAttachedTo( source, 31, 2, 200, 200, 200, 150, 0 ) outputChatBox ( " Blip made" ) end, 100, 1, source ) end end ) addEventHandler( "onClientElementStreamOut", getRootElement(), function() if getElementType( source ) == "pickup" then if ( id[source] ) then destroyElement ( source ) end end end ) my other question is about custom models for cars and customs txds. i havent seen a public script that shows how custom models and txds are used. ive tried to follow this page on the wiki and get this example script to work.http://development.mtasa.com/index.php?title=EngineReplaceModel but however it doesnt and the euros is not replaced on running the scipt , if some one could complie a working example script or give me some tips that would be awsome. ive tried to condense my post and not post too much , well it is my first post here ! im excited to get replys and be active in this community ! Link to comment
Gamesnert Posted September 6, 2008 Share Posted September 6, 2008 It's very easy to see why ALL pickups have a blip, getElementType(...)=="pickup" looks if it's a pickup. No matter what kind of. I would suggest giving the houses some element data, by using setElementData. And in the blip code, use getElementData to retrieve it. On the engine code side, did you add the files in your meta.xml? Never forget that if you want to do custom models, you need to add to the meta. Otherwise it doesn't work. Hope it helps. Link to comment
Guest Posted September 6, 2008 Share Posted September 6, 2008 thanks for your fast reply. however i dont completely understand how to use set element data. i have read through that wiki page. however im unsure how to apply it to the khic house script. im possibly too begginner. could your elaborate ? and in the meta xml i allready used file src. but i stil dont have custom modeels or txds working. Link to comment
Gamesnert Posted September 6, 2008 Share Posted September 6, 2008 thanks for your fast reply. however i dont completely understand how to use set element data. i have read through that wiki page. however im unsure how to apply it to the khic house script. im possibly too begginner.could your elaborate ? and in the meta xml i allready used file src. but i stil dont have custom modeels or txds working. Ok. setElementData is basically a kind of variable for a specific element. Example on setElementData: This example will check if a gate is open, and closes it if so. And opens otherwise. function gateToggle() local isGateOpened=getElementData(gate,"opened") or false --Or false is there to not give an error if it fails. I always use that in these cases if isGateOpened==false then moveObject(gate,nX,nY,nZ) setElementData(gate,"opened",true) elseif isGateOpened==true then --Note! elseif is NOT a typo! moveObject(gate,oX,oY,oZ) setElementData(gate,"opened",false) end end addCommandHandler("gate",gateToggle) Note that this is an UNTESTED EXAMPLE code. Also, could you post the script you currently use for the model change here? There might be a problem in it. Also, if you're in-game and logged in as an admin, type "/debugscript 3" to check if there are any errors in the client-side script. Link to comment
Scarface Posted September 6, 2008 Share Posted September 6, 2008 nice work mate! keep up the good work, its nice to see some effort around here from beginners, although the script might come out wrong 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