Raised This Month: $51 Target: $400
 12% 

BOMB Effects Camera


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
666
Senior Member
Join Date: Mar 2015
Old 05-15-2018 , 15:50   BOMB Effects Camera
Reply With Quote #1

It is possible to make a camera effect like that of the video, if all the players are dead CT and TT or all the players of a team are dead, make a camera give effect so that they can see the bomb until the next round, and that it works with mp_fadetoblack 1. Whether the bomb is planted or not, and that they can not switch to any other spectator camera

https://www.youtube.com/watch?v=lOun0mEkGjU
666 is offline
sekac
Senior Member
Join Date: Nov 2016
Old 05-16-2018 , 15:39   Re: BOMB Effects Camera
Reply With Quote #2

So just lock the free look camera above where the c4 is planted so you can still look around? That'd be sweet.
sekac is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 05-16-2018 , 16:36   Re: BOMB Effects Camera
Reply With Quote #3

this would be a great plugin
tarsisd2 is offline
karimoo97
Member
Join Date: Apr 2018
Location: Tamazgha
Old 05-16-2018 , 18:57   Re: BOMB Effects Camera
Reply With Quote #4

Quote:
Originally Posted by tarsisd2 View Post
this would be a great plugin
Indeed, Hopefully someone will make it
karimoo97 is offline
sekac
Senior Member
Join Date: Nov 2016
Old 05-17-2018 , 07:12   Re: BOMB Effects Camera
Reply With Quote #5

Quote:
Originally Posted by karimoo97 View Post
Indeed, Hopefully someone will make it
Well I have the basics done. When there are no teammates left alive and the bomb is planted you are stuck spectating the bomb, now I need to figure out how to allow looking around.
sekac is offline
sekac
Senior Member
Join Date: Nov 2016
Old 05-17-2018 , 08:02   Re: BOMB Effects Camera
Reply With Quote #6

Here is this test plugin, I know it works if you plant the bomb and die with no teammates left alive and there is at least 1 ct left alive. You must be in first person camera too. Hopefully it helps someone.
Edited this plugin: Link

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>

new PLUGIN[] = "Spectator Camera";
new 
VERSION[] = "0.1 Beta";
new 
AUTHOR[] = "Multiply";

new 
MODEL[] = "models/player/vip/vip.mdl";

new 
bool:bombPlanted;
new 
giCameraEntity;
new 
bool:gbCameraActive[33];

new 
bool:specEnabledT;
new 
bool:specEnabledCT;

new const 
g_szBombModel[] = "models/w_c4.mdl"

new Float:g_fBombOrigin[3]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_clcmd("camera",     "CameraToggle");
    
register_clcmd("+camera",     "CameraActivate");
    
register_clcmd("-camera",     "CameraDeactivate");
    
    
register_forward(FM_StartFrame"fwdServerFrame");
    
    
register_logevent("logevent_PlantedTheBomb"3"2=Planted_The_Bomb")
    
    
register_event("DeathMsg""EventDeath""a")
    
    
CameraInit();
}

public 
plugin_precache()
    
precache_model(MODEL);

public 
juhp_eventPlayerSpawn(iPlayerId) {
    
CameraDeactivate(iPlayerId);
}

public 
client_disconnect(iPlayerId) {
    
CameraDeactivate(iPlayerId);
    
countAlivePlayers(iPlayerId);
}
    
public 
CameraInit() {
    
giCameraEntity engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"));     // Create Camera Entity
    
set_pev(giCameraEntity,     pev_classname,         "Multiply_Camera");                 // Give the Camera a name
    
set_pev(giCameraEntity,     pev_solid,         SOLID_NOT);                    // Make the Camera semiclip
    
engfunc(EngFunc_SetModel,     giCameraEntity,     MODEL);                     // Set Camera Model (Needed, for EngFunc_SetView to work properly)
    
set_pev(giCameraEntity,     pev_movetype,         MOVETYPE_FLY);                    // Stop the Camera from dropping on the ground
    
set_pev(giCameraEntity,     pev_health,        1.0);                        // Set Camera health to 1
    
set_pev(giCameraEntity,     pev_takedamage,        0.0);                        // Make Camera invincible
    
set_pev(giCameraEntity,     pev_rendermode,     5);                        // Fix rendermode
    
set_pev(giCameraEntity,     pev_renderamt,         0.0);                        // Make it less visable
    
set_pev(giCameraEntity,     pev_angles,         Float:{0.0180.00.0});            // Test using angles
    
CameraSetOrigin(Float:{0.00.00.0});                                    // Place Camera in the middle of the map
}


public 
CameraSetOrigin(Float:fOrigin[3]) {
    new 
Float:fMins[3], Float:fMaxs[3];
    
pev(giCameraEntitypev_minsfMins);
    
pev(giCameraEntitypev_maxsfMaxs);
    
engfunc(EngFunc_SetSizegiCameraEntityfMinsfMaxs);

    return 
engfunc(EngFunc_SetOrigingiCameraEntityfOrigin);
}

public 
CameraToggle(iPlayerId) {
    switch (
gbCameraActive[iPlayerId]) {
        case 
true:     CameraDeactivate(iPlayerId);
        case 
false:     CameraActivate(iPlayerId);
    }
    return 
PLUGIN_HANDLED;
}
public 
CameraActivate(iPlayerId) {
    if (!
is_user_alive(iPlayerId)) {
        
engfunc(EngFunc_SetViewiPlayerIdgiCameraEntity);
        
gbCameraActive[iPlayerId] = true;
    }
    
    return 
PLUGIN_HANDLED;
}

public 
CameraDeactivate(iPlayerId) {
    
engfunc(EngFunc_SetViewiPlayerIdiPlayerId);
    
gbCameraActive[iPlayerId] = false;
    return 
PLUGIN_HANDLED;
}

public 
logevent_PlantedTheBomb()
{
    new 
iC4 = -1
    
if((iC4 find_ent_by_model(iC4"grenade"g_szBombModel))) 
    {  
        
pev(iC4pev_origing_fBombOrigin)
        
CameraSetOrigin(g_fBombOrigin)
        
bombPlanted true
    
}
}

public 
countAlivePlayers(id) {
    if(!
bombPlanted) return
    new 
iPlayers[32], iTAliveiCTAlive
    
get_players(iPlayersiTAlive"ae""TERRORIST"); 
    
get_players(iPlayersiCTAlive"ae""CT"); 
    
    
specEnabledT = !clamp(iTAlive01)
    
specEnabledCT = !clamp(iCTAlive01)

    for(new 
032i++)
        if(
get_user_team(i) == && specEnabledT || get_user_team(i) == && specEnabledCT)
            
set_task(5.0"CameraActivate"i)

}

public 
EventDeath() {
    new 
id read_data(2)
    
countAlivePlayers(id)

sekac is offline
666
Senior Member
Join Date: Mar 2015
Old 01-04-2019 , 20:15   Re: BOMB Effects Camera
Reply With Quote #7

Quote:
Originally Posted by sekac View Post
Here is this test plugin, I know it works if you plant the bomb and die with no teammates left alive and there is at least 1 ct left alive. You must be in first person camera too. Hopefully it helps someone.
Edited this plugin: Link

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>

new PLUGIN[] = "Spectator Camera";
new 
VERSION[] = "0.1 Beta";
new 
AUTHOR[] = "Multiply";

new 
MODEL[] = "models/player/vip/vip.mdl";

new 
bool:bombPlanted;
new 
giCameraEntity;
new 
bool:gbCameraActive[33];

new 
bool:specEnabledT;
new 
bool:specEnabledCT;

new const 
g_szBombModel[] = "models/w_c4.mdl"

new Float:g_fBombOrigin[3]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_clcmd("camera",     "CameraToggle");
    
register_clcmd("+camera",     "CameraActivate");
    
register_clcmd("-camera",     "CameraDeactivate");
    
    
register_forward(FM_StartFrame"fwdServerFrame");
    
    
register_logevent("logevent_PlantedTheBomb"3"2=Planted_The_Bomb")
    
    
register_event("DeathMsg""EventDeath""a")
    
    
CameraInit();
}

public 
plugin_precache()
    
precache_model(MODEL);

public 
juhp_eventPlayerSpawn(iPlayerId) {
    
CameraDeactivate(iPlayerId);
}

public 
client_disconnect(iPlayerId) {
    
CameraDeactivate(iPlayerId);
    
countAlivePlayers(iPlayerId);
}
    
public 
CameraInit() {
    
giCameraEntity engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"));     // Create Camera Entity
    
set_pev(giCameraEntity,     pev_classname,         "Multiply_Camera");                 // Give the Camera a name
    
set_pev(giCameraEntity,     pev_solid,         SOLID_NOT);                    // Make the Camera semiclip
    
engfunc(EngFunc_SetModel,     giCameraEntity,     MODEL);                     // Set Camera Model (Needed, for EngFunc_SetView to work properly)
    
set_pev(giCameraEntity,     pev_movetype,         MOVETYPE_FLY);                    // Stop the Camera from dropping on the ground
    
set_pev(giCameraEntity,     pev_health,        1.0);                        // Set Camera health to 1
    
set_pev(giCameraEntity,     pev_takedamage,        0.0);                        // Make Camera invincible
    
set_pev(giCameraEntity,     pev_rendermode,     5);                        // Fix rendermode
    
set_pev(giCameraEntity,     pev_renderamt,         0.0);                        // Make it less visable
    
set_pev(giCameraEntity,     pev_angles,         Float:{0.0180.00.0});            // Test using angles
    
CameraSetOrigin(Float:{0.00.00.0});                                    // Place Camera in the middle of the map
}


public 
CameraSetOrigin(Float:fOrigin[3]) {
    new 
Float:fMins[3], Float:fMaxs[3];
    
pev(giCameraEntitypev_minsfMins);
    
pev(giCameraEntitypev_maxsfMaxs);
    
engfunc(EngFunc_SetSizegiCameraEntityfMinsfMaxs);

    return 
engfunc(EngFunc_SetOrigingiCameraEntityfOrigin);
}

public 
CameraToggle(iPlayerId) {
    switch (
gbCameraActive[iPlayerId]) {
        case 
true:     CameraDeactivate(iPlayerId);
        case 
false:     CameraActivate(iPlayerId);
    }
    return 
PLUGIN_HANDLED;
}
public 
CameraActivate(iPlayerId) {
    if (!
is_user_alive(iPlayerId)) {
        
engfunc(EngFunc_SetViewiPlayerIdgiCameraEntity);
        
gbCameraActive[iPlayerId] = true;
    }
    
    return 
PLUGIN_HANDLED;
}

public 
CameraDeactivate(iPlayerId) {
    
engfunc(EngFunc_SetViewiPlayerIdiPlayerId);
    
gbCameraActive[iPlayerId] = false;
    return 
PLUGIN_HANDLED;
}

public 
logevent_PlantedTheBomb()
{
    new 
iC4 = -1
    
if((iC4 find_ent_by_model(iC4"grenade"g_szBombModel))) 
    {  
        
pev(iC4pev_origing_fBombOrigin)
        
CameraSetOrigin(g_fBombOrigin)
        
bombPlanted true
    
}
}

public 
countAlivePlayers(id) {
    if(!
bombPlanted) return
    new 
iPlayers[32], iTAliveiCTAlive
    
get_players(iPlayersiTAlive"ae""TERRORIST"); 
    
get_players(iPlayersiCTAlive"ae""CT"); 
    
    
specEnabledT = !clamp(iTAlive01)
    
specEnabledCT = !clamp(iCTAlive01)

    for(new 
032i++)
        if(
get_user_team(i) == && specEnabledT || get_user_team(i) == && specEnabledCT)
            
set_task(5.0"CameraActivate"i)

}

public 
EventDeath() {
    new 
id read_data(2)
    
countAlivePlayers(id)

it would be much better if it were in free look and not in first person, there is some way to change it
__________________
666 is offline
Reply



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 23:45.


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