Raised This Month: $ Target: $400
 0% 

Spectate system


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 05-24-2013 , 13:20   Spectate system
Reply With Quote #1

Hello once more!

Can we write a spectate system for cs 1.6? without use mp_forcecamera, mp_forcechasecam and etc.?

Each dead player can view only his alive teammates (fps, free chase cam, locked chase cam). Admin can view everybody alive in both teams (all spectator's mode include free look).

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define ADMIN_LEVEL ADMIN_BAN

new g_iMaxPlayers

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Killed"player""OnCBasePlayer_Killed_Post"true)
    
g_iMaxPlayers get_maxplayers()
}

public 
OnCBasePlayer_Killed_Postidkiller )
{
    if( !
killer || killer g_iMaxPlayers || id == killer )
    {
        return
    }
   
    new 
players[32], inum
    get_players
(playersinum)
       
    for (new 
0inum; ++i)
    {
        new 
iTeam cs_get_user_team(id)  // get team of dead player
        
        
if(is_user_admin(id))
        {
            
// admin can spectate everybody
            // ?.. if(is_user_alive(players[i])
            // ?.. set_view(random....
        
}
        else
        {
            
// dead player (access level "user") can view ONLY everybody in his team)
            // ?.. if(is_user_alive(players[i]) && (cs_get_user_team(players[i]) == iTeam))
            // ?.. set_view(random....
        
}
    }

__________________
sorry my bad english...

Last edited by alonelive; 05-24-2013 at 13:22.
alonelive is offline
 


Thread Tools
Display Modes

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 16:27.


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