Problem z widokiem za pleców
Andrzejek
03.08.2012
Dodałem coś takiego, żeby gracz w CT dostawał widok za pleców:
Wszystko fajnie działa, tylko ze gracz jest lekko nie widzialny, i jak to pod koniec rundy wyłączyć?
set_view(i, CAMERA_3RDPERSON)
Wszystko fajnie działa, tylko ze gracz jest lekko nie widzialny, i jak to pod koniec rundy wyłączyć?
dasiek
04.08.2012
Create_PlayerCamera( id ) { new iEnt; static const sClassname[] = "classname"; while( ( iEnt = engfunc( EngFunc_FindEntityByString, iEnt, sClassname, g_sCamclass ) ) != 0 ) { if( pev( iEnt, pev_owner) == id ) { engfunc( EngFunc_SetView, id, iEnt ); return; } } static const sInfo_target[] = "info_target"; iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, sInfo_target ) ) if( !iEnt ) return; static const sCam_model[] = "models/w_usp.mdl"; set_pev( iEnt, pev_classname, g_sCamclass ); engfunc( EngFunc_SetModel, iEnt, sCam_model ); set_pev( iEnt, pev_solid, SOLID_TRIGGER ); set_pev( iEnt, pev_movetype, MOVETYPE_FLY ); set_pev( iEnt, pev_owner, id ); set_pev( iEnt, pev_rendermode, kRenderTransTexture ); set_pev( iEnt, pev_renderamt, 0.0 ); engfunc( EngFunc_SetView, id, iEnt ); set_pev( iEnt, pev_nextthink, get_gametime() ); } public Think_PlayerCamera( iEnt ) { static sClassname[32]; pev( iEnt, pev_classname, sClassname, sizeof sClassname - 1 ); if( !equal( sClassname, g_sCamclass ) ) return FMRES_IGNORED; static iOwner; iOwner = pev( iEnt, pev_owner ); if( !is_user_alive( iOwner ) ) return FMRES_IGNORED; static iButtons; iButtons = pev( iOwner, pev_button ); if( iButtons & IN_USE ) { engfunc( EngFunc_SetView, iOwner, iOwner ); engfunc( EngFunc_RemoveEntity, iEnt ); return FMRES_IGNORED; } static Float:fOrigin[3], Float:fAngle[3]; pev( iOwner, pev_origin, fOrigin ); pev( iOwner, pev_v_angle, fAngle ); static Float:fVBack[3]; angle_vector( fAngle, ANGLEVECTOR_FORWARD, fVBack ); fOrigin[2] += 20.0; fOrigin[0] += ( -fVBack[0] * 150.0 ); fOrigin[1] += ( -fVBack[1] * 150.0 ); fOrigin[2] += ( -fVBack[2] * 150.0 ); engfunc( EngFunc_SetOrigin, iEnt, fOrigin ); set_pev( iEnt, pev_angles, fAngle ); set_pev( iEnt, pev_nextthink, get_gametime() ); return FMRES_HANDLED; }
Dodajesz do pluginu. W plugin_init dodajesz
register_forward( FM_Think, "Think_PlayerCamera" );
Przed plugin init dodajesz
new const g_sCamclass[] = "PlayerCamera";
Zmień
set_view(i, CAMERA_3RDPERSON)
na
Create_PlayerCamera( id );
Użytkownik CheQ edytował ten post 04.08.2012 16:02
Andrzejek
04.08.2012
Bo dałem ze pokazuje za pleców, ale sie przycina tak troche gre? Gra nie jest płynna
I jak to wyłączyć?
Użytkownik Andrzejek edytował ten post 04.08.2012 17:53
I jak to wyłączyć?
Użytkownik Andrzejek edytował ten post 04.08.2012 17:53