Jump to content

Race Ghostmode.


GTX

Recommended Posts

Hello, as you may know, there's a bug in race ghostmode. When I'm trying to enable/disable ghostmode, it just doesn't...

Any ideas?

I tried many options and none of them did actualy work properly:

#1:

  
function GM(player) 
    if not isGuestAccount(getPlayerAccount(player)) and isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup"Admin") then 
        if getElementData(player, "overrideCollide.uniqueblah") == nil or not getElementData(player, "overrideCollide.uniqueblah") then 
            for i, v in ipairs(getElementsByType"player") do 
                setElementData(v, "overrideCollide.uniqueblah", 0, true) 
            end 
            outputChatBox('* Ghostmode enabled by ' .. getPlayerName(player), root, 0, 255, 0) 
        else 
            for i, v in ipairs(getElementsByType"player") do 
                setElementData(v, "overrideCollide.uniqueblah", nil, true) 
            end 
            outputChatBox('* Ghostmode disabled by ' .. getPlayerName(player), root, 255, 0, 0) 
        end 
    end 
end 
addCommandHandler('gm', GM) 
addCommandHandler('ghostmode', GM) 

- Doesn't disable/enable.

#2:

function GM(player) 
    if not isGuestAccount(getPlayerAccount(player)) and isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup"Admin") then 
for i, v in ipairs(getElementsByType"player") do 
            if getElementCollisionsEnabled(getPedOccupiedVehicle(v)) then 
                setElementCollisionsEnabled(getPedOccupiedVehicle(v), false) 
                outputChatBox('* Ghostmode disabled by ' .. getPlayerName(player), v, 255, 0, 0) 
            else 
                setElementCollisionsEnabled(getPedOccupiedVehicle(v), true) 
                outputChatBox('* Ghostmode enabled by ' .. getPlayerName(player), root, 0, 255, 0) 
            end 
        end 
    end 
end 
addCommandHandler('gm', GM) 
addCommandHandler('ghostmode', GM) 

- Strange bug... When it disables, I can fly and texture/model of the car is... messing somehow.

Screenshots:

- http://shrani.si/f/26/bP/utJ6Dn5/mta-sc ... 2616-2.png (LOL)

Thanks in advance.

Link to comment

Ah woopsie. Okay, I got it now. But I got a strange error in this code:

function GM() 
    for i, v in ipairs(getElementsByType"vehicle") do 
        if isElementCollidableWith(v, v) == true then 
            setElementCollidableWith(v, v, false) 
        else 
            setElementCollidableWith(v, v, true) 
        end 
    end 
end 
addCommandHandler("gm", GM) 

But wtf...

Error: attempt to call global 'isElementCollidableWith' (a nil value)

Link to comment

Uhm, I tried with the code below, but it doesn't work...

What can I do?

  
function GM() 
    for i, v in ipairs(getElementsByType"vehicle") do 
        if isElementCollidableWith(v, v) then 
            setElementCollidableWith(v, v, false) 
        else 
            setElementCollidableWith(v, v, true) 
        end 
    end 
end 
addCommandHandler("gm", GM) 

Link to comment
function GM ( ) 
    local vehicle = getPedOccupiedVehicle ( localPlayer ) 
    if ( vehicle ) then 
        for _, v in ipairs ( getElementsByType"vehicle" ) do 
            setElementCollidableWith ( v, vehicle, not isElementCollidableWith ( v, vehicle ) ) 
        end 
    end 
end 
addCommandHandler ( "gm", GM ) 

Try that.

Link to comment
  
function GM ( ) 
    for i,r in ipairs(getElementsByType("player")) do 
        local vehicle = getPedOccupiedVehicle ( r ) 
        if ( vehicle ) then 
            for _, v in ipairs ( getElementsByType"vehicle" ) do 
                setElementCollidableWith ( v, vehicle, not isElementCollidableWith ( v, vehicle ) ) 
            end 
        end 
    end 
end 
addCommandHandler ( "gm", GM ) 
  

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...