Hey.
I have this code:
Code:
public WejdzWCialo(id)
{
fm_set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 100) // A - changing visibility Player
new iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target")) // B - create a ent
set_pev(iEnt, pev_classname, "player_hat") // B
engfunc(EngFunc_SetModel, iEnt, "models/cod_jasnowidz.mdl") // B
set_pev(iEnt, pev_movetype, MOVETYPE_FOLLOW) // C - created the ent follows the victim of wybrany[id]
set_pev(iEnt, pev_aiment, wybrany[id]) // C
set_pev(iEnt, pev_owner, wybrany[id]) // C
new info[2] // D - data transfer set_task
info[0] = id // D
info[1] = wybrany[id] // D
engfunc(EngFunc_SetView, id, iEnt) // C - code on the so-called "spectator mode"
set_pev(id,pev_sequence,107)
set_pev(id,pev_gaitsequence,6)
set_pev(id,pev_iuser1,2)
set_pev(id,pev_iuser2,wybrany[id])
set_pev(id,pev_frame,255.0)
set_pev(id,pev_framerate,1.0) // end C
set_task(SLEDZ.0, "KoniecPodgladu",.parameter=info, .len=2) // D
}
public KoniecPodgladu(info[2])
{
new id = info[0] // D
new sledzony = info[1] // D
engfunc(EngFunc_SetView, id, id) // E - ent transition from model
set_pev(id,pev_sequence,75) // C - remove the "spectator mode"
set_pev(id,pev_gaitsequence,1)
set_pev(id,pev_iuser1,0)
set_pev(id,pev_iuser2,0)
set_pev(id,pev_frame,float(random(35)+110))
set_pev(id,pev_framerate,1.0) // end C
new iEnt = fm_find_ent_by_owner(-1, "player_hat", sledzony) // F - detection ent
engfunc(EngFunc_RemoveEntity, iEnt) // F - delete ent
fm_set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255) // getting rid of invisibility
}
This causes the player enters the ent created on another player.
All around him he sees as a spectator (See below).
After clicking the "DUCK" opens a window on the bottom and the player can afford to change the view of the other player. I would like to block, or otherwise adjust the camera.
Maybe somehow through "pev_body"? I would ask for the sample code.
Thank you for your answers.