Jump to content

Help with this script


brad

Recommended Posts

Posted

hi friends recently some friends helped me create a script type and smoke and good and all but something goes wrong, I activate the script (smoke) or click alt normally and remains active: S, then I would know who helps me when I hold the button turn activated the smoke and if I stop button turns off the smoke

thanks

client

addEvent("fxNitro",true) 
  
local nitro = {} 
  
function FxNitro(veh) 
   if nitro[veh] and isTimer(nitro[veh]) then killTimer(nitro[veh]) end  
  
   if getVehicleController(veh) then  
        local x,y,z = getElementPosition(veh)  
        local rx,ry,rz = getElementRotation(veh) 
        rz = math.rad(rz-180) 
        local dx,dy = math.cos(rz)*2,math.sin(rz)*2  
        fxAddTankFire(x,y,z,dx,dy,z)  
        nitro[veh] = setTimer(FxNitro,500,1,veh)  nuevamente el efecto 
   end 
end 
addEventHandler("fxNitro",getRootElement(),FxNitro)  

server

function FxNitro(jugador) 
    local veh = getPedOccupiedVehicle(jugador)  
    if veh then 
        triggerClientEvent("fxNitro",jugador, veh) que agreguen el efecto. 
    end 
end 
  
addEventHandler("onPlayerJoin",getRootElement(),function() 
    bindKey(source,"vehicle_fire", "down", FxNitro) llamar la función cuando este active el nitro. 
end) 

:D:D

Posted

Comments always start with this "--"

So this is WRONG

llamar la función cuando este active el nitro. 

CORRECT

--llamar la función cuando este active el nitro. 

Add -- on your other comments too and post your debug errors.

Posted

CaPy, he's asking how to make it stop the effect when he stops pressing the button, not that he has a bug in the script.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
CaPy, he's asking how to make it stop the effect when he stops pressing the button, not that he has a bug in the script.

I know, but anyway...

  • 1 year later...

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