Change parameters in a model in specific time with DifferentialEquations

Thanks, Chris for the prompt reply. Tried:

function lorenz!(du,u,p,t)
 du[1] = a*(u[2]-u[1])
 du[2] = u[1]*(b-u[3]) - u[2]
 du[3] = u[1]*u[2] - c*u[3]
end

And

function affect!(integrator)
    integrator.p[1] = 2
end

But got this error (I am using julia 1.0.4 btw):

MethodError: no method matching setindex!(::DiffEqBase.NullParameters, ::Int32, ::Int32)