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,VERSION, AUTHOR);
register_forward( FM_CmdStart, "FMCmdStart" );
register_concmd(ADMIN_SLAY)
}
public FMCmdStart( id, uc_handle, randseed )
{
new Float:fmove, Float:smove;
get_uc(uc_handle, UC_ForwardMove, fmove);
get_uc(uc_handle, UC_SideMove, smove );
new Float:maxspeed;
pev(id, pev_maxspeed, maxspeed);
new Float:walkspeed = (maxspeed * 0.52);
fmove = floatabs( fmove );
smove = floatabs( smove );
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,VERSION, AUTHOR);
register_forward( FM_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 FMCmdStart( id, uc_handle, randseed )
{
new Float:fmove, Float:smove;
get_uc(uc_handle, UC_ForwardMove, fmove);
get_uc(uc_handle, UC_SideMove, smove );
new Float:maxspeed;
pev(id, pev_maxspeed, maxspeed);
new Float:walkspeed = (maxspeed * 0.52);
fmove = floatabs( fmove );
smove = floatabs( smove );
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,VERSION, AUTHOR);
register_forward( FM_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 FMCmdStart( id, uc_handle, randseed )
{
new Float:fmove, Float:smove;
get_uc(uc_handle, UC_ForwardMove, fmove);
get_uc(uc_handle, UC_SideMove, smove );
new Float:maxspeed;
pev(id, pev_maxspeed, maxspeed);
new Float:walkspeed = (maxspeed * 0.52);
fmove = floatabs( fmove );
smove = floatabs( smove );
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)
}
}