-
Posts
2,973 -
Joined
-
Last visited
-
Days Won
3
Everything posted by 50p
-
1. If the server is hosted on your PC, you can use your local IP to connect to the server. If your server is hosted somewhere else then you have to use its IP. 2. ? 3. You can use whichever you like (default is 22004).
-
1. onClientLogin is server-side only. 2. "The source of this event is the client element that just logged in." 3. Parameters for a function are wrong. 4. Don't attach this event handler to resources' root element, because player element (player who joins for example) are in the Root of the element tree. Unless you player element is a child of the resource (e.g. you're a team member of a team created by this resource) 5. Read wiki a lot.
-
Does these black line show up in-game for models made in SketchUp or you used a texture with a black border? Because it doesn't look good.
-
Don't create new TXDs. Just modify the one from game. There might be some data missing in custom created TXD files.
-
Learning the usage of GUI from freeroam is not a good idea. 1st thing you need to do is create a tab panel, then you can add the tabs to it. To add other gui to the tab you need to set its parent (last argument in gui functions) to the tab (not tabpanel).
-
Do you create the vehicles from map file? This code respawns vehicles that were "born" by map file and the map file is in the same resource as this code. If you want to respawn ALL the vehicle created by map files in other resources, use this one: addEventHandler( "onVehicleExplode", getRootElement( ), function( ) local parent = getElementParent( source ) if getElementType( parent ) == "map" and getElementID( parent ) ~= "dynamic" then setTimer( respawnVehicle, 5000, 1, source ) else setTimer( destroyElement, 5000, 1, source ) end end ) (NOT TESTED)
-
So you want to program a scripting editor? If you are a programmer it isn't difficult for you to start. I haven't heard of someone making such editor, but I've heard someone is making GUI editor (not an in-game editor).
-
I don't see anything special about this code, but if you think it is worth posting it in useful code topic then post it there.
-
This code will respawn vehicle from map file (of the resource this code is pasted in). It will destroy following vehicles: - vehicles from other resources - vehicles created in this resource which are not in the map file (eg. createVehicle) addEventHandler( "onVehicleExplode", getRootElement( ), function( ) local parent = getElementParent( source ) if getElementType( parent ) == "map" and getElementID( parent ) ~= "dynamic" then local parentRes = getElementParent( parent ) if parentRes == getResourceRootElement( getThisResource( ) ) then setTimer( respawnVehicle, 5000, 1, source ) else setTimer( destroyElement, 5000, 1, source ) end else setTimer( destroyElement, 5000, 1, source ) end end )
-
You can do the same as in the "broph" resource but change from "root" to getResourceRootElement( getThisResource( ) ) in the event handler (broph.lua file line 265) That will respawn only vehicles from your resource (including map file). If you want to destroy them completely from the game you'd have to check if the vehicle is in your map file. Like: addEventHandler( "onVehicleExplode", getRootElement( ), function( ) local parent = getElementParent( source ) if getElementType( parent ) == "map" then local parentRes = getElementParent( parent ) if parentRes == getThisResource( ) then setTimer( respawnVehicle, 5000, 1, source ) else setTimer( destroyElement, 5000, 1 source ) end else setTimer( destroyElement, 5000, 1 source ) end end ) (NOT TESTED)
-
As eAi said, this code doesn't make any problems... You should pay more attention to the functions that synch data, eg. triggerClient/ServerEvent or setElementData. If you have more code that synch data between clients and server then show it and we may tell you what's wrong or tell us what you're trying to do so we could maybe give you alternative way.
-
Use addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), clientResStart) to prevent triggering the server event whenever any resource starts.
-
I think it will also give you this "error" when you use setElementData, because the data must be synched between server and clients therefore it must be packetized before it's sent.
-
True. Alexander, use onClientResourceStart instead. I have a question though, is F5 key bound in client-side script or server-side?
-
1. Try to add the textItem to textDisplay before you show it to the player, so just move it aboute textDisplayAddObserver 2. setElementData is used to synch variables so you can use it in client-side script. You can't synch textItem because it's server-side only.
-
Take a look into my modshop resource and you will see that you can set "camera position" and "camera look at" in the same frame. In the file gui.lua you'll find a function rotateCameraAroundPlayer (which is at the bottom of the file). That function is called every frame when you are tuning your vehicle. Also look at lines 75, 76.
-
Try to set your interior to something else then 0 and you will see there will be no buildings (city buildings, roads, trees, etc.) visible, that's because they are all in the interior of 0.
-
Line 4: ')' is not needed. In Lua you close function by adding just "end" which you've done and that's fine. Just remove ) from line 4.
-
I haven't tried so I can't say it will work for tanks: http://development.mtasa.com/index.php? ... amageProof It seems that tank is not DamageProof, but maybe it will change the tanks stats.
-
If you can't find an event or a function by using the search tool, try simply clicking the links on the left (navigation).
-
Do you get paid for spamming? Read before you post. Learn to read a bit before posting. Permanent builders are set in the offedit.lua file under the if/then statement for on player join, and on resource start, if you want to add someone, put it in there. You have to be an admin or permanent builder in order to use it.
-
What do you mean by saying "doesn't support"? Jesus... "doesn't give possibility" to use mods or "doesn't allow" to play with mods or "MTA developers don't like mods"... Just come to term mta is not supposed to be played with mods.
-
Triple post! You should be warned... 1. Do you read wiki? createCollisionSphere? (createColSphere) 2. You createObject in command only, so how do you expect it to work in any other way? Everything seems fine but... - change the createCollisionSphe to createColSphere - createObject when resource starts or with colshape ... and it should be ok.
-
Just after my post I started making my list and when I visited this topic I saw your list... my time was wasted... anyway here is my list http://y50p.50g.com/mtasa/misc/lua.api It contains all the dp3 functions (up to today) all of the dp3 functions are suffixed "dp3".
-
If I knew how to do it I'd probably do it... but that's right, make that file with a thousand of functions is quiet boring.