Raised This Month: $ Target: $400
 0% 

Help needed..


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
StormZone
BANNED
Join Date: Nov 2008
Location: [RO]Hunedoara/Petrosani
Old 10-12-2009 , 12:46  
#1

Hy again.
Y managed to repair the entangle roots from uwc3x.
Y even added a sound if the ultimate is stoped by the other player blink or necklace of immunity.
Here is the code.
PHP Code:
public searchtarget(parm[2])
{
    new 
id parm[0];
    new 
enemybody;
    
get_user_aiming(id,enemy,body);
    
    if ( (
0<enemy<=32) && (!hasblink[enemy] && playeritem[enemy]!=IMMUNITY) )
    { 
        new 
iparm[2];
        
iparm[0] = enemy;
        
iparm[1] = 1;
    }
    else
    {
        if ( 
Util_Should_Msg_Clientenemy ) )
        {
            
set_hudmessage 25525510, -1.0, -0.410.53.00.20.2);
            
show_hudmessage enemy"Enemy Ultimate Blocked^n..Entangle Roots.." );
            if ( 
file_exists"sound/uwc3x/ultimate_stopped.wav" ) == )
            {
                
emit_soundenemyCHAN_ITEM"uwc3x/ultimate_stopped.wav"1.0ATTN_NORM0PITCH_NORM );
            }    
        }
    }

    if ( 
0<enemy<=32 && !stunned[enemy] && get_user_team(id)!=get_user_team(enemy) && playeritem[enemy]!=IMMUNITY && !hasblink[enemy] && is_user_alive(id) && is_user_alive(enemy) && !temp_immunity[enemy] )
    {
        
issearching[id]=false;
        
ultimateused[id]=true;
        
icon_controller(id);
    
        if ( 
Util_Should_Msg_Clientid ) )
        {
            if ( 
file_exists "sound/uwc3x/entanglingroots.wav" ) == )
            {
                
emit_sound idCHAN_STATIC"uwc3x/entanglingroots.wav"1.0ATTN_NORM0PITCH_NORM );
            }
        }

        new 
waitparm[6];
        
waitparm[0]=enemy;
        
waitparm[1]=100;
        
waitparm[5]=floatround(get_user_maxspeed(enemy));
        
set_user_maxspeed(enemy,1.0);
        
Task_Entangle_Stop(waitparm);

        
stunned[enemy]=true;
        new 
cooldownparm[1];
        
cooldownparm[0]=id;
        
set_task CVAR_ENTANGLE_COOLDOWN"cooldown"50 idcooldownparm);
    }
    else
    {
        
issearching[id]=true;
        
icon_controller(id);
        new 
counter parm[1];
        while (
counter >= 0)
        {
            
counter -= 10;
            if (
counter==0)
            
emit_sound(id,CHAN_ITEM"turret/tu_ping.wav"1.0ATTN_NORM0PITCH_NORM)
        }

        --
parm[1]
        if (
parm[1]>&& get_user_health(id)>0)
        {
            
set_task(0.1"searchtarget"TASK_ULTIMATE_ENTANGLE_SEARCH+idparm2);
        }
        else
        {
            
issearching[id]=false;
            
icon_controller(id);
        }
    }
    return 
PLUGIN_CONTINUE

First y will eplain how this works.
This is and bindable ultimate.ex: bind f "wcentangle"
When y pres the bind button it start searching for and enemy to entangle.
When y aim at the enemy if he isnt protected by blink or necklace of immunity he will get entagled.But if he is he will recive this
PHP Code:
        if ( Util_Should_Msg_Clientenemy ) )
        {
            
set_hudmessage 25525510, -1.0, -0.410.53.00.20.2);
            
show_hudmessage enemy"Enemy Ultimate Blocked^n..Entangle Roots.." );
            if ( 
file_exists"sound/uwc3x/ultimate_stopped.wav" ) == )
            {
                
emit_soundenemyCHAN_ITEM"uwc3x/ultimate_stopped.wav"1.0ATTN_NORM0PITCH_NORM );
            }    
        } 

The problem is that the ultimate for 5 seconds after pressing the bind button it tries to impale the enemy you aim every 0.1 seconds.
PHP Code:
set_task(0.1"searchtarget"TASK_ULTIMATE_ENTANGLE_SEARCH+idparm2); 
How can y do it that if the player(in this case enemy) blocked your entagle to stop searching for an player to entagle him and activate this task
PHP Code:
set_task CVAR_ENTANGLE_COOLDOWN"cooldown"50 idcooldownparm); 
Thanks in advance.

EDIT:

Y fotgot to ad this to.

PHP Code:
public Task_Entangle_Stop parm[6] )
{
    new 
id=parm[0];
    new 
origin[3];
    
get_user_origin idorigin );

    if ( 
origin[0] == parm[2] && origin[1] == parm[3] && origin[2] == parm[4] )
    {
        new 
normalspeed parm[5];
        new 
resetparm[2];
        
resetparm[0] = id;
        
resetparm[1] = normalspeed;
        
set_task float parm[1]/10 ), "reset_maxspeed"TASK_RESET_MAXSPEED id resetparm);

        new 
entangleparm[2];
        
entangleparm[0] = parm[0];
        
entangleparm[1] = parm[1];
        
Event_Entangle entangleparm );
    }
    else
    {
        
parm[2] = origin[0];
        
parm[3] = origin[1];
        
parm[4] = origin[2];
        
set_task 0.1"Task_Entangle_Stop"TASK_ENTANGLE_STOPparm);
    }

    return 
PLUGIN_CONTINUE;


Last edited by Exolent[jNr]; 10-12-2009 at 12:49. Reason: It was only an hour and no one posted. Therefore, you can easily edit your first post.
StormZone is offline
Send a message via Yahoo to StormZone Send a message via Skype™ to StormZone
 



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 22:34.


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