Raised This Month: $ Target: $400
 0% 

How to rewrite "spectator mode" to not be able to change players?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Drago36
Junior Member
Join Date: Jul 2014
Old 07-12-2014 , 11:07   How to rewrite "spectator mode" to not be able to change players?
Reply With Quote #1

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

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.

Last edited by Drago36; 07-13-2014 at 02:28. Reason: Adding small details
Drago36 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode