Raised This Month: $ Target: $400
 0% 

specswitch fix


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lqlqlq
Senior Member
Join Date: Jan 2008
Old 09-22-2011 , 14:02   specswitch fix
Reply With Quote #1

Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "set spectate"
#define VERSION "1.0"
#define AUTHOR "naven & alliedmodders"

new oldSpecTeam[33];

// get/set mapzone bits
#define CS_GET_USER_MAPZONES(%1) get_pdata_int(%1, OFFSET, OFFSET_LINUX_DIFF)
#define CS_SET_USER_MAPZONES(%1,%2) set_pdata_int(%1, OFFSET, %2, OFFSET_LINUX_DIFF)
#define DELAY 0.3 
#define TOTAL 0
#define DROPED 1
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /spec", "setSpectate");
}
public setSpectate(id)
{    
    new team;
    team = get_pdata_int(id, 114, 5);
    switch(team)
    {
        case 1:
        {
            oldSpecTeam[id] = 1;
            cs_set_user_team(id, CS_TEAM_SPECTATOR, CS_DONTCHANGE);
            if(is_user_alive(id))
                user_kill(id);
        }
        case 2:
        {
            oldSpecTeam[id] = 2;
            cs_set_user_team(id, CS_TEAM_SPECTATOR, CS_DONTCHANGE);
            if(is_user_alive(id))
                user_kill(id);
        }
        case 3:
        {
            switch(oldSpecTeam[id])
            {
                case 1:
                {
                    cs_set_user_team(id, CS_TEAM_T, CS_T_TERROR);
                    set_task(0.5, "task_afterSpecChange", id);
                }
                default:
            {
                cs_set_user_team(id, CS_TEAM_CT, CS_CT_GIGN);
                set_task(0.5, "task_afterSpecChange", id);
            }
        }
    }
    default: return FMRES_IGNORED;
}

    return PLUGIN_CONTINUE;
}

public task_afterSpecChange(id)
{
//log_amx("AT: task_afterSpecChange");

dllfunc(DLLFunc_Spawn, id);
}
Sometimes after type /spec and go back with /spec i not see the HUD - "health, armor, crosshire, ammo", maybe this is bug.
Please, fix it.

Last edited by lqlqlq; 09-22-2011 at 14:07.
lqlqlq is offline
tiltedShrimp
Member
Join Date: Feb 2024
Old 02-26-2024 , 19:12   Re: specswitch fix
Reply With Quote #2

Bump, Im facing the same issue (Half Life server)

Last edited by tiltedShrimp; 02-26-2024 at 19:14.
tiltedShrimp is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 02-27-2024 , 10:30   Re: specswitch fix
Reply With Quote #3

I think this does not apply to HL only cstrike
__________________
mlibre is offline
tiltedShrimp
Member
Join Date: Feb 2024
Old 02-27-2024 , 10:46   Re: specswitch fix
Reply With Quote #4

Quote:
Originally Posted by mlibre View Post
I think this does not apply to HL only cstrike
Thank you for your reply ! I'd like to note that I have joined multiple servers, where there's an option to get out of the spectators mode by pressing "ENTER' key and then selecting #Menu_Spectate to get back into the game. The plugin also seems to push a message in the chat for everyone to see whenever someone enters or leaves the spectator's mode. If someone knows of this particular plugin, I'd really appreciate linking it to me !

Adding an example photo:
https://i.imgur.com/S8jluK2.jpeg

Last edited by tiltedShrimp; 02-27-2024 at 11:36.
tiltedShrimp 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 09:09.


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