Raised This Month: $ Target: $400
 0% 

[HELP!] Admin Free Look


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diva
Member
Join Date: Aug 2012
Location: Denmark
Old 11-06-2013 , 08:10   [HELP!] Admin Free Look
Reply With Quote #1

Hello, im using this very useful plugin on my servers, it makes every admins in my moderator team with access "H" able to spectate both teams when they are dead, instead of having to go to spectate everytime to spectate someone on the opposite team,
However, i'm experiencing some minor bugs, and i have no idea how to fix them /:

BUGS:
  1. When you are dead, it will after some time show you in spectators and every players can see that aswell
    then it will put you back to the team you were in on the next round

  2. When dead, and you are using normal chat it will act like if you were spectating too example:
    [SPEC] Player: Dont swear please even if i was a CT player.

  3. Won't allow us to use amx_transfer spec, it will put us to spectator, but when round starts it will also put you back to the team you were in s: even if we use chat command /spec

Please someone if you can fix it, help me with this, it is making players very suspecious, also my mod team gets annoyed.

Heres the script code:

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

#define PLUGIN "Admin Free Look"
#define VERSION "2.0"
#define AUTHOR "Jim"

#define ADMIN_ACCESS    ADMIN_CFG    //flag "h"

#define SPECT_KEYS    MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6|MENU_KEY_0
#define CLASS_KEYS    MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5

#define LINUXDIFF    5

#if cellbits == 32
    #define OFFSET_TEAM 114
#else
    #define OFFSET_TEAM 139
#endif

#define TEAM_T        1
#define TEAM_CT        2
#define TEAM_SPEC    3

new bool:g_roundend
new bool:g_corpse_made[33]
new 
bool:g_model_selected[33]
new 
g_team[33]
new 
g_maxplayers

stock bool
:is_admin(id)
    return 
g_team[id] && get_user_flags(id) & ADMIN_ACCESS true false

stock bool
:is_admin_dead(id)
    return 
is_admin(id) && g_corpse_made[id] ? true false

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""new_round""a""1=0""2=0")
    
register_logevent("round_end"2"1=Round_End")
    
register_event("ClCorpse""hook_corpse""a""12>0")
    
register_event("TeamInfo""event_teaminfo""a""1>0")
    
register_event("TextMsg""joined_a_team""a""1=1""2=#Game_join_terrorist""2=#Game_join_ct")
    
    
register_clcmd("jointeam""join_spec_cmd")
    
register_clcmd("joinclass""select_a_model")
    
register_menucmd(register_menuid("IG_Team_Select_Spect",1), SPECT_KEYS"join_spec_menucmd")
    
register_menucmd(register_menuid("Terrorist_Select"1), CLASS_KEYS"select_a_model")
    
register_menucmd(register_menuid("CT_Select"1), CLASS_KEYS"select_a_model")
    
    
g_maxplayers get_maxplayers()
}

public 
client_connect(id)
{
    
g_team[id] = 0
    g_model_selected
[id] = false
    g_corpse_made
[id] = false
}

public 
client_disconnect(id)
{
    
g_team[id] = 0
    g_model_selected
[id] = false
    g_corpse_made
[id] = false
}

public 
event_teaminfo()
{
    new 
id read_data(1)
    new 
team[2]
    
read_data(2team1)
    switch(
team[0])
    {
        case 
'T'g_team[id] = TEAM_T
        
case 'C'g_team[id] = TEAM_CT
        
case 'S'g_team[id] = TEAM_SPEC
    
}
}

public 
stay_spec(id)
{
    if(
g_team[id] != TEAM_SPEC)
    {
        
g_team[id] = TEAM_SPEC
        message_begin
(MSG_ALLget_user_msgid("TeamInfo"))
        
write_byte(id)
        
write_string("SPECTATOR")
        
message_end()
    }
}

public 
join_spec_cmd(id)
{
    new 
argv[2]
    
read_argv(1argv1)
    if(
argv[0] == '6')
        
stay_spec(id)
}

public 
join_spec_menucmd(idkey)
{
    if(
key == 5)
        
stay_spec(id)
}

public 
joined_a_team()
{
    new 
name[32]
    
read_data(3name31)
    new 
id get_user_index(name)
    
g_model_selected[id] = false
}

public 
select_a_model(id)
{
    
g_model_selected[id] = true
    
if(!g_roundend && is_admin(id))
        
set_task(1.0"delay"id)
}

public 
delay(id)
{
    if(
g_team[id] && !is_user_alive(id))
    {
        
g_corpse_made[id] = true
        free_look
(id)
    }
}

public 
hook_corpse()
{
    new 
id read_data(12)
    
g_corpse_made[id] = true
    
if(!g_roundend && is_admin(id))
        
free_look(id)
}

public 
free_look(id)
{
    if(!
g_roundend && is_admin_dead(id) && g_model_selected[id])
        
set_pdata_int(idOFFSET_TEAMTEAM_SPECLINUXDIFF)
}

public 
round_end()
{
    
g_roundend true
    freelook_over
()
}

public 
new_round()
{
    
g_roundend false
    freelook_over
()
}

public 
freelook_over()
{
    for(new 
id 1id <= g_maxplayersid++)
    {
        if(
is_admin_dead(id) && get_pdata_int(idOFFSET_TEAMLINUXDIFF) == TEAM_SPEC && g_team[id] != TEAM_SPEC)
            
set_pdata_int(idOFFSET_TEAMg_team[id], LINUXDIFF)
        
g_corpse_made[id] = false
    
}

Diva is offline
Old 11-06-2013, 08:17
Don_Collione
This message has been deleted by ConnorMcLeod. Reason: completely wrong, please avoid that kind of posts
Diva
Member
Join Date: Aug 2012
Location: Denmark
Old 11-06-2013 , 10:33   Re: [HELP!] Admin Free Look
Reply With Quote #2

Nope, it still bugs, sometimes it works perfect, other times its the same thing. and i have no idea why xD

Maybe its bcus there isnt anything in the code that tells me like, if i die then i should stay "DEAD" or something, because when im dead chat is "*SPEC*" and its annoying.

Last edited by Diva; 11-06-2013 at 10:36.
Diva is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 11-07-2013 , 02:15   Re: [HELP!] Admin Free Look
Reply With Quote #3

Need that plugin too. Any PRO can fix that?
Debesėlis is offline
Old 11-07-2013, 16:08
Don_Collione
This message has been deleted by asherkin.
Old 11-07-2013, 17:11
joshknifer
This message has been deleted by asherkin.
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 11-21-2013 , 05:39   Re: [HELP!] Admin Free Look
Reply With Quote #4

another bug in this plugin : server doing Game Commencing. Can anyone fix ?
Debesėlis 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 06:16.


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