Jump to content

Aiuto, il primo topic serio (HUNTERICS GUARDA)


Recommended Posts

:? Allora questo script l'ho trovato cazzeggiando per i forums, è il car fade ma solo il ''client'', ecco ora cerco chi mi fa il ''server'' e magari il meta :3 l'unico possibile qui è hunterics quindi muovi il culo e aiutami :D

:arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown::arrowdown:

me = getLocalPlayer() 
raceState = "" 
  
  
function carFade() 
local my_vehicle = getPedOccupiedVehicle(me) 
if not my_vehicle then return end 
local vx, vy, vz = getElementPosition ( my_vehicle ) 
local CubeA = {} 
for id, vehicle in ipairs ( getElementsByType("vehicle") ) do   
        if getVehicleOccupant(vehicle) and vehicle ~= my_vehicle and not isElementCollidableWith(my_vehicle, vehicle) and raceState == "Running" then 
                local x,y,z = getElementPosition(vehicle) 
                local dist = getDistanceBetweenPoints3D( vx, vy, vz, x, y, z) 
                if not getElementData(vehicle, "carfade") then setElementData(vehicle, "carfade", 1, false ) end 
                if  dist <= 50 then     
                        local minx, miny, minz, maxx, maxy, maxz = getElementBoundingBox ( my_vehicle ) 
                        local a = maxx - minx 
                        local b = maxy - miny 
                        local c = maxz - minz 
                        local radius1 = math.sqrt( a^2 + b^2 + c^2 ) 
                        minx, miny, minz, maxx, maxy, maxz = getElementBoundingBox ( vehicle )  
                        a = maxx - minx 
                        b = maxy - miny 
                        c = maxz - minz 
                        local radius2 = math.sqrt( a^2 + b^2 + c^2 ) 
                        local radius = (radius1 + radius2 ) / 1.2 
                        
                        if dist < radius then 
                                setElementData(vehicle, "carfade", math.max(0, getElementData(vehicle, "carfade") - 0.1), false ) 
                        else 
                                setElementData(vehicle, "carfade", math.min (1, getElementData(vehicle, "carfade") + 0.1) , false ) 
                        end 
                else 
                        setElementData(vehicle, "carfade", math.min (1, getElementData(vehicle, "carfade") + 0.1) , false ) 
                end 
                setElementAlpha(vehicle, getElementData(vehicle, "carfade") * 245 + 10) 
                setElementAlpha(getVehicleOccupant(vehicle), getElementData(vehicle, "carfade") * 245 + 10) 
        end 
end 
end 
  
  
  
carFadeOn = false 
  
bindKey("F4", "down", function() 
if carFadeOn then 
        outputChatBox("Carfade disabled") 
        removeEventHandler( "onClientRender", root, carFade ) 
else 
        addEventHandler( "onClientRender", root, carFade ) 
        outputChatBox("Carfade enabled") 
end 
carFadeOn = not carFadeOn 
end 
) 
  
  
addEvent("onClientRaceStateChanging", true) 
addEventHandler("onClientRaceStateChanging", root, 
function(newstate) 
raceState = newstate 
end 
) 

:arrowup::arrowup::arrowup::arrowup::arrowup::arrowup::arrowup::arrowup::arrowup::arrowup::arrowup::arrowup::arrowup::arrowup::arrowup:

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