Raised This Month: $ Target: $400
 0% 

[SOLVED] Need help with my anti move and shoot plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Qvintus
Junior Member
Join Date: Sep 2009
Old 04-24-2011 , 18:50   [SOLVED] Need help with my anti move and shoot plugin
Reply With Quote #1

Hello you probaly think I'm weired. Anyways I figured it would be good with this plugin for my aim training, as I need to stand still everytime I shoot, else my bullets wont hit.

Anyways I need to make my plugin kill me everytime I don't stand still while shooting.

This is what I picked up on the forums for moveing, but I'm not sure where I finde the rest I need to finish this.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

new PLUGIN[]="ProMoveTraining"
new AUTHOR[]="SND Qvintus"
new VERSION[]="1.00"

plugin_init()
{
    
register_plugin(PLUGIN,VERSIONAUTHOR);
    
register_forwardFM_CmdStart"FMCmdStart" );
    
register_concmd(ADMIN_SLAY)
}
public 
FMCmdStartiduc_handlerandseed )
{
    new 
Float:fmoveFloat:smove;
    
get_uc(uc_handleUC_ForwardMovefmove);
    
get_uc(uc_handleUC_SideMovesmove );

    new 
Float:maxspeed;
    
pev(idpev_maxspeedmaxspeed);
    new 
Float:walkspeed = (maxspeed 0.52); 
    
fmove floatabsfmove );
    
smove floatabssmove );
    
    if(
fmove <= walkspeed && smove <= walkspeed && !(fmove == 0.0 && smove == 0.0))
    {
        
// Walking
        
    
}
    else
    {
        
//Running  
    
}

So as you can see I still need it to check when I shoot, and if so execute the ADMIN_SLAY command on me. Is there anywhere I can pickup these commands without haveing to see through the whole libary?


UPDATE: Here is what I've come up with so far.

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

new PLUGIN[]="ProMoveTraining"
new AUTHOR[]="SND Qvintus"
new VERSION[]="1.00"

new moveing

plugin_init
()
{
    
register_plugin(PLUGIN,VERSIONAUTHOR);
    
register_forwardFM_CmdStart"FMCmdStart" );
    
register_concmd(ADMIN_SLAY)
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_ak47""ham_ak_Attack")
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_m4a1""ham_colt_Attack")
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_deagle""ham_deagle_Attack")
}
public 
FMCmdStartiduc_handlerandseed )
{
    new 
Float:fmoveFloat:smove;
    
get_uc(uc_handleUC_ForwardMovefmove);
    
get_uc(uc_handleUC_SideMovesmove );

    new 
Float:maxspeed;
    
pev(idpev_maxspeedmaxspeed);
    new 
Float:walkspeed = (maxspeed 0.52); 
    
fmove floatabsfmove );
    
smove floatabssmove );
    
    if(
fmove <= walkspeed && smove <= walkspeed && !(fmove == 0.0 && smove == 0.0))
    {
        
// Walking
        
moveing true;
    }
    else
    {
        
//Running 
        
moveing true;
    }
    
    if(
fmove == 0.0 && smove == 0.0)
    {
        
//Standing
        
moveing false;
    }
}

public 
ham_ak_Attack(weapon_entity)
{
    if (
moveing){
        
//ADMIN_SLAY player
    
}

}

public 
ham_colt_Attack(weapon_entity)
{
    if (
moveing) {
        
//ADMIN_SLAY player
    
}

}

public 
ham_deagle_Attack(weapon_entity)
{
    if (
moveing) {
        
//ADMIN_SLAY player
    
}

OR! I could use this ?

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

new PLUGIN[]="ProMoveTraining"
new AUTHOR[]="SND Qvintus"
new VERSION[]="1.00"

new moveing

plugin_init
()
{
    
register_plugin(PLUGIN,VERSIONAUTHOR);
    
register_forwardFM_CmdStart"FMCmdStart" );
    
//register_concmd(ADMIN_SLAY)
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_ak47""ham_ak_Attack")
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_m4a1""ham_colt_Attack")
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_deagle""ham_deagle_Attack")
}
public 
FMCmdStartiduc_handlerandseed )
{
    new 
Float:fmoveFloat:smove;
    
get_uc(uc_handleUC_ForwardMovefmove);
    
get_uc(uc_handleUC_SideMovesmove );

    new 
Float:maxspeed;
    
pev(idpev_maxspeedmaxspeed);
    new 
Float:walkspeed = (maxspeed 0.52); 
    
fmove floatabsfmove );
    
smove floatabssmove );
    
    if(
fmove <= walkspeed && smove <= walkspeed && !(fmove == 0.0 && smove == 0.0))
    {
        
// Walking
        
moveing true;
    }
    else
    {
        
//Running 
        
moveing true;
    }
    
    if(
fmove == 0.0 && smove == 0.0)
    {
        
//Standing
        
moveing false;
    }
}

public 
ham_ak_Attack(weapon_entity)
{
    if (
moveing){
        
user_kill(attacker)
    }

}

public 
ham_colt_Attack(weapon_entity)
{
    if (
moveing) {
        
user_kill(attacker)
    }

}

public 
ham_deagle_Attack(weapon_entity)
{
    if (
moveing) {
        
user_kill(attacker)
    }


Last edited by Qvintus; 04-24-2011 at 20:38.
Qvintus is offline
 



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 19:50.


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