Jump to content

Server bugs


Apocalypso

Recommended Posts

:$Hi... i am new here, but already need help, and i hope this is right place...

So i tryed to build a server for Role-Play, well i used some base gamemode from internet, i dont remember where i got it but that does not really what i will ask about..

So.. I basically edited it , updated and even make new stuffs, like flood, narcotic systems, amm new factions like Los Santos Coast guard, mapped whole new place(Islands) , federal jail... food, drink systems, fishing system from base fish i updated it like there now can fish on big boats with nets... and added amm how it is in english... well u know objects i guess. amm and there starts bugs... or i dont even what it is.. i thinked that this is some error in my whole script... i searched about 2 monts. but then i realised other servers in my country who provide role-play, or other servers with objects, got same problem

So:Basic problem

1) I spawn item 1557 (doors)

2) I edit it by arrow keys and wasd to its place, and save it and protect it (because some morons always steal it by picking up...)

3) I putted other side a gold bar worth 40 K Euros...

4) Went to sleep

Next morning:

1) Doors was in place gold bar = dissapeared ...

So somebody get trough unmoovable doors, okaay, i searched in logs files, the one who picked it up, find the one who stealed it, and "Nicely" asked : what the fu** man..

so he answered that there is posibility to kick or hit trough all materials (objects) who is doors but only once per dimension. So basically this bug ruin folowing resources...

Gates,factions,object-system, elevators and everything else who got connected which those objects, but the point of this post is simple, this is even fixable? because for real i tryed by myself, every door could be hitted and it open for 1 time... then u do recconect and can do it again... or this is some GTA bug and i will need to live with it?

 

thanks and sorry about bad english :/

Link to comment

I understand the bug you're talking about, where you hit the door it swings open once and then returns back to it's solid state.

Only thing I can suggest is to use scripts to prevent the usage of the bug, such as disable the ability to punch if a player is standing next to a door.

Link to comment

So i need to add some function that will find nearby elements who is about "x" feets ahead player? Amm i guess like this one?

function objFix (? , ? )

local px, py, pz = getElementPosition(thePlayer)

local doors = getElementsByType("object")

for k, v in ipairs(doors ) do

if isElement( v ) and getElementModel( v, "doors") == 1557 and ((ETC objects )) then

local x, y, z = getElementPosition(object)

if getDistanceBetweenPoints3D( x, y, z, px, py, pz ) < 2 then

toggleControl("fire",false)

else

toggleControl("fire", true)

end

end

end

 

i guess this should help but this is just a draft for now :D

 

 

Link to comment

.... maked a function in object client sided file.... got new problems...

- debugscript 3 aint show any errors, but togglecontrol aint working..

Maked object with id 1557 its doors. then i put them on ground, and do protect on it, next i got cords of door, example 0  0 0 then i walk to 20 0 0 or 0 20 0 because in script i make that if doors x y z , player x y z < 20 then togglecontrol("fire" false) but it aint falsing... i guess i make some mistake in function start wehere i define a doors, but on other scripts where objects defined like that it works...

here is function i use

 

function disablePunch ( x, y, z, px, pz, py, model,localPlayer)
      
    if  ( model == 1557 )  then
        
         local px, py, pz = getElementPosition(localPlayer)
         local x, y, z = getElementPosition(model)
         local distanc = getDistanceBetweenPoints3D(x, y, z, px, py, pz)
       if (distanc < 20 ) then
            toggleControl("fire",false)
        
        outputChatBox("Test bug 1")
       else
        toggleControl("fire",true)
                       outputChatBox("Test bug 2")
       end
    end
end
addEventHandler("onClientResourceStart", getRootElement(), disablePunch)

Even outputchatbox aint give those texts..

Edited by Apocalypso
Link to comment

okay just tyed another style

  function onPlayerTarget (targetElem, thePlayer )
        
    
   if  ( getElementModel ( targetElem ) == 1557 ) then
    	local px, py, pz = getElementPosition(source)
	    local x, y, z = getElementPosition(targetElem)
	    
	    if tonumber(getDistanceBetweenPoints3D(x, y, z, getElementPosition(source))) < 20 then
       
        toggleControl ( source, "fire", false )
    else

        toggleControl ( source, "fire", true )
        end

    end
 end
addEventHandler ( "onPlayerTarget", root, onPlayerTarget )

Now it just push some Warnings : expected element at argument 1 got boolean and it is only where are if (getelementmodel) but when i add under toggle - outputchat, its working, but still give warning errors, and toggle aint working.. well oky i think i just dont know how to do proper definiton of that model :D

Link to comment

Try this

function onPlayerTarget (targetElem, thePlayer )
        
    
   if getElementType ( targetElem ) == "object" and getElementModel ( targetElem ) == 1557 then
    	local px, py, pz = getElementPosition(source)
	    local x, y, z = getElementPosition(targetElem)
	    
	if tonumber(getDistanceBetweenPoints3D(x, y, z, getElementPosition(source))) < 20 then
       
        	toggleControl ( source, "fire", false )
    	else

        	toggleControl ( source, "fire", true )
        end
    else
    	outputChatBox("No Target", source)
    end
 end
addEventHandler ( "onPlayerTarget", root, onPlayerTarget )

Also expected element = boolean means there was no target so targetElem was returning false meaning all code below this

if ( getElementModel ( targetElem ) == 1557 ) then

will not be triggered.

 

Edited by harryh
Link to comment

Aint working... well output is working, but i still can punch doors... also i got this warning

LUA 4: Bad argument @ 'getElementType' [Expected element at argument 1, got boolean]  [DUP x3]

 

Outpuchatbox is spaming all time when i dont look, aim on doors, then there is no warnings, but when i aim straigt on doors it say that there is no element but only bool

Edited by Apocalypso
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...