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

Aim help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SomeBastard
Junior Member
Join Date: Oct 2011
Old 12-02-2011 , 09:06   Aim help
Reply With Quote #1

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

#pragma semicolon 1

new g_Enabled;
new g_msgScreenFade;
new bool:g_AlreadyZoomed[33];

public plugin_init() {
    register_plugin( "Scope Alert", "1.1", "xPaw" );
    
    register_forward( FM_PlayerPreThink, "fwdPlayerPreThink" );
    
    g_Enabled    = register_cvar( "sv_scopealert", "1" );
    g_msgScreenFade    = get_user_msgid( "ScreenFade" );
}

public fwdPlayerPreThink( id ) {
    if( get_pcvar_num(g_Enabled) && is_user_alive(id) ) {
        new iTarget, iBody;
        get_user_aiming( id, iTarget, iBody );
        
        if( is_user_alive(iTarget) && !g_AlreadyZoomed[iTarget] && get_user_team(id) != get_user_team(iTarget) ) {
            if ( CS_SET_FIRST_ZOOM <= cs_get_user_zoom(id) <= CS_SET_SECOND_ZOOM ) {
                message_begin( MSG_ONE_UNRELIABLE, g_msgScreenFade, _, iTarget );
                write_short( 500 );    // duration
                write_short( 500 );    // hold time
                write_short( SF_FADE_IN );    // flags
                write_byte( 255 );    // red
                write_byte( 010 );    // green
                write_byte( 010 );    // blue
                write_byte( 60 );    // alpha
                message_end();
                
                // Doing delay, to prevent total red screen on target. :)
                g_AlreadyZoomed[iTarget] = true;
                set_task(2.0, "fnRemoveZoomed", iTarget);
            }
        }
    }
}

public client_connect( id )
    if( get_pcvar_num(g_Enabled) )
        g_AlreadyZoomed[id] = false;

public fnRemoveZoomed( id )
    g_AlreadyZoomed[id] = false;
What to change so that it alerts players whenever they get aimed at ? (with or without scope)

cs_get_user_zoom to get_user_aiming or something like that ? :S
SomeBastard is offline
Send a message via MSN to SomeBastard
INJAC
Member
Join Date: Sep 2011
Old 12-02-2011 , 18:03   Re: Aim help
Reply With Quote #2

i need this thing to so can anyone help?
INJAC 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 13:59.


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