Jump to content

[HELP] custom object, roads, and spawn


A3kri

Recommended Posts

[HELP] custom object, and roads

Hello, I'm new to this community and MTA ..

I've searched for my problem in the forum but with no good results

1. Apparently my server roads sometime glitches or whatever do you call it, it drops the players into the sea.

or when he is on a car the car drowns and he stays on the ground and sometimes he just leave the car.

2. My other problem is, i made a custom object but now it's duplicated

its one over another.

and when i remove the object creation from the .map, the custom object disappears.

406286_440722105959203_482120320_n.jpg

this is my object creation code in the .map

    "object (lasairprt5) (1)" doublesided="false" model="4828" interior="0" dimension="0" posX="1481" posY="-2300.1999511719" posZ="12.5" rotX="0" rotY="0" rotZ="0"> 
  

this is my custom.lua

addEventHandler('onClientResourceStart', resourceRoot,
        function()
            outputChatBox ( "Dawar Al-Lulu is started")
     
            local txd = engineLoadTXD('files/lasairprt5.txd',true)
            engineImportTXD(txd, 4828)
     
            local dff = engineLoadDFF('files/lasairprt5.dff', 0)
            engineReplaceModel(dff, 4828)
     
            local col = engineLoadCOL('files/lasairprt5.col')
            engineReplaceCOL(col, 4828)
            engineSetModelLODDistance(4828, 500)
        end
    )

and this is my meta.xml


       

3. My third problem is, in play gamemode I've set the spawn place

and it's working but the spawn skin isn't working it just spawns the default cj's one "0"

Link to comment

For Custom objects maybe the createObject is better.

1 - Remove the object in .map

2 - Try This :

  
addEventHandler('onClientResourceStart', resourceRoot, 
        function() 
            createObject ( 4828, 1481, -2300.1999511719, 12.5, 0, 0, 0 )                  
            outputChatBox ( "Dawar Al-Lulu is started")     
            local txd = engineLoadTXD('files/lasairprt5.txd',true) 
            engineImportTXD(txd, 4828)     
            local dff = engineLoadDFF('files/lasairprt5.dff', 0) 
            engineReplaceModel(dff, 4828) 
            local col = engineLoadCOL('files/lasairprt5.col') 
            engineReplaceCOL(col, 4828) 
            engineSetModelLODDistance(4828, 500) 
        end 
    ) 
  

or

  
addEventHandler('onClientResourceStart', resourceRoot, 
        function() 
            createObject ( 4828, 1481, -2300.1999511719, 12.5, 0, 0, 0 )                  
            outputChatBox ( "Dawar Al-Lulu is started")     
            setTimer ( customObject, 200, 1) 
        end 
    ) 
  
function customObject () 
 local txd = engineLoadTXD('files/lasairprt5.txd',true) 
 engineImportTXD(txd, 4828)     
 local dff = engineLoadDFF('files/lasairprt5.dff', 0) 
 engineReplaceModel(dff, 4828) 
 local col = engineLoadCOL('files/lasairprt5.col') 
 engineReplaceCOL(col, 4828) 
engineSetModelLODDistance(4828, 500) 
end 
  
  

Link to comment

@Hunterix: first thanks for your reply

and the first code just removed my custom object and spawned one underground :|

and your second did change anything but made it the same

so now I'm using your second code waiting for more solution

anyways thanks :)

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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