AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   fast zoom (https://forums.alliedmods.net/showthread.php?t=219982)

kimilover 07-05-2013 12:47

fast zoom
 
guys i need your help with one plugin. I want when someone make Speed Shot with awp shows a message in the game: The Player Low make a Speed Shot with AWP.
i try to find some solutions to make it with myself but i cant.

Bos93 07-05-2013 14:04

Re: fast zoom
 
Quote:

Speed Shot with awp
What is this?

kimilover 07-05-2013 19:00

Re: fast zoom
 
Speed shot is when you press right click and without wait to aim someone with zoom you press the left click.. You press right click and one second later you press left click to shoot.. That is the speed shot

kimilover 07-06-2013 15:39

Re: fast zoom
 
that is the code that it dont works...
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "FAST ZOOM HIT"
#define VERSION "1.0"
#define AUTHOR "Nefos"

new g_MAXPLAYERS
new boolzoomless[33]
new 
boolfastshot[33]
#define APLAYER(%1)  ( 1 <= killer <= g_MAXPLAYERS ) 

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forwardFM_PlayerPreThink"fw_prethink" );
    
RegisterHamHam_Killed"player""ham_killed" );
    
g_MAXPLAYERS get_maxplayers()
}

public 
fw_prethink(id) {
    
    if (!
is_user_alive(id)) 
        return 
FMRES_IGNORED;
    
    static 
gun;
    new 
ifzoomkey;
    
gun get_user_weapon(id);
    
ifzoom cs_get_user_zoom(id);
    
key pevidpev_button );
    
fastshot[id] = ( key IN_ATTACK && key IN_ATTACK2 && gun == CSW_AWP && ifzoom == CS_SET_FIRST_ZOOM)
    
zoomless[id] = ( key IN_ATTACK && gun == CSW_AWP  && ifzoom == CS_SET_NO_ZOOM )
    return 
FMRES_IGNORED;
    
    
}

public 
ham_killedvictimkillershouldgib ) {
    if(
APLAYER(victim) && APLAYER(killer))
    {
        if(!
fastshot[killer] && !zoomless[killer]) {
            return 
HAM_IGNORED;
        }
        else {
            new 
victimname[32], killername[32]
            
get_user_namevictimvictimname31 )
            
get_user_namekillerkillername31 )
            if(
fastshot[killer])    {
                
client_print(0print_chat,"[Kapsimo.net] %s make a fast-zoom kill"killername)
            }
            
            else if(
zoomless[killer])
            {
                
client_print(0print_chat,"[Kapsimo.net] %s make a zoom-less kill"killername)
            }
        }
    }
    return 
HAM_IGNORED;



Bos93 07-06-2013 16:36

Re: fast zoom
 
PHP Code:

#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

#define PLUGIN_NAME "New-Plugin"
#define PLUGIN_VERSION "0.0.0.1"
#define PLUGIN_AUTHOR "x"

#define MAX_CLIENTS 32

new Float:g_flFastShotMAX_CLIENTS +];

public 
plugin_init()
{
    
register_plugin 
    

        
PLUGIN_NAME
        
PLUGIN_VERSION
        
PLUGIN_AUTHOR
    
);

    
RegisterHamHam_Weapon_SecondaryAttack"weapon_awp""CBaseWeapon_SecondaryAttack_Pre", .Post false );
    
RegisterHamHam_Killed"player""CBasePlayer_Killed_Pre", .Post false );
}

public 
CBaseWeapon_SecondaryAttack_PrepEntity )
{
    if( 
pev_validpEntity ) != )
    {
        return 
HAM_IGNORED;
    }

    
g_flFastShotget_pdata_cbasepEntity 41 ) ] = get_gametime( ) + 1.0;

    return 
HAM_IGNORED;
}

public 
CBasePlayer_Killed_PrepVictimpKiller )
{
    if( !
is_user_alivepKiller ) )
        return 
HAM_IGNORED;

    if( 
g_flFastShotpKiller ] >= get_gametime( ) )
    {
        
client_print0print_chat,  "Fast Shot.." );
    }

    return 
HAM_IGNORED;



kimilover 07-06-2013 17:11

Re: fast zoom
 
do you try this code?

kimilover 07-07-2013 06:36

Re: fast zoom
 
i try your code and it didnt work from me do you have something else in your mind?

Bos93 07-07-2013 17:58

Re: fast zoom
 
My code is correct.

kimilover 07-08-2013 07:34

Re: fast zoom
 
tell me exactly how it works..

kimilover 07-11-2013 11:19

Re: fast zoom
 
OK the problem is fixed. thx a lot bos93 for your script and your time..


All times are GMT -4. The time now is 06:23.

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