Thread: Push zombie
View Single Post
Author Message
hajter
Junior Member
Join Date: Jul 2012
Old 11-22-2012 , 19:54   Push zombie
Reply With Quote #1

Hello.
I have question, anyone know how to do to be able to push the zombies using the IN_USE?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <zp50_core>

#define PLUGIN "Push player"
#define VERSION "1.0"
#define AUTHOR "OneEyed & Sn!ff3r"

new cvar

public plugin_init() 
{
        
register_plugin(PLUGINVERSIONAUTHOR)
        
        
cvar register_cvar("amx_moveplayer""1")
        
        
register_touch("player""player""touchtouch")        
}

public 
touchtouch(playerplayer2)
{
        new 
Float:aim[2][3]
        new 
Floatdif 
        entity_get_vector
(playerEV_VEC_v_angleaim[0])
        
entity_get_vector(player2EV_VEC_v_angleaim[1])
                
        if(
aim[0][1]<0aim[0][1]+=360.0
        
if(aim[1][1]<0aim[0][1]+=360.0
        
        
if(aim[0][1]>aim[1][1]) dif aim[0][1]-aim[1][1]
        else 
dif aim[1][1]-aim[0][1]
                
        if(
dif>90) return

        if(
get_pcvar_num(cvar))
        {
                if((!(
task_exists(player 1000 player2))) && (!(task_exists(player2 1000 player))) && (get_user_button(player2) & IN_USE) && zp_core_is_zombie(player) && zp_core_is_zombie(player2))
                {
                        new 
Float:speed[2][3]
                        new 
Float:over_speed[3]
                        
                        
set_task(0.2"empty_space"player 1000 player2)
                        
set_task(0.2"empty_space"player2 1000 player)
                        
                        
entity_get_vector(playerEV_VEC_velocityspeed[0])
                        
entity_get_vector(player2EV_VEC_velocityspeed[1])
                        
                        for(new 
03i++)
                        {
                                
over_speed[i] = speed[0][i] + speed[1][i]
                                
speed[0][i] += over_speed[i] * 0.65
                                speed
[1][i] -= over_speed[i] * 0.65
                        
}
                        
entity_set_vector(playerEV_VEC_velocityspeed[0])
                        
entity_set_vector(player2EV_VEC_velocityspeed[1])
                }
        }
}

public 
empty_space() {} 

Last edited by hajter; 11-22-2012 at 19:55.
hajter is offline