Raised This Month: $32 Target: $400
 8% 

EngFunc_TraceToss


  
 
 
Thread Tools Display Modes
Author Message
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 05-29-2011 , 02:04   EngFunc_TraceToss
#1

Descripción:
Traza el punto donde el movimiento de alguna entidad terminará. Si por alguna razón el movimiento de la entidad es bloqueada por otra (o por worldspawn), TraceToss detectará la situación.

Uso:
Code:
engfunc(EngFunc_TraceToss, ent, skipent, tr);
Parámetros:
ent = La entidad cuyo movimiento queremos trazar.
skipent = La entidad que omitiremos en el trazo.
tr = Resultado (trace result).

Post original: http://forums.alliedmods.net/showpos...&postcount=138

Grenade Prediction:
Es un plugin simple que hace que cuando un jugador tira una granada se cree un efecto de chispas donde se sabe que va a golpear.

Video

La idea original es de joaquimandrade.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

const m_bIsC4 96;

public 
plugin_init( )
{
    
register_plugin"Grenade Prediction""1.0.1""DruX" );
    
    
RegisterHamHam_Think"grenade""Ham_Think_Pre");
}

public 
Ham_Think_PreiEnt )
{
    if ( 
get_pdata_intiEntm_bIsC4) & ( 1<<) )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iTraceiTrace create_tr2( );
    
    static 
Float:fOrigin];
    
    
engfuncEngFunc_TraceTossiEntIGNORE_MONSTERSiTrace );
    
    
get_tr2iTraceTR_vecEndPosfOrigin );
    
    
engfuncEngFunc_MessageBeginMSG_BROADCASTSVC_TEMPENTITYfOrigin);
    
write_byteTE_SPARKS );
    
engfuncEngFunc_WriteCoordfOrigin] );
    
engfuncEngFunc_WriteCoordfOrigin] );
    
engfuncEngFunc_WriteCoordfOrigin] );
    
message_end( );
    
    
free_tr2iTrace );
    
    return 
HAM_IGNORED;

__________________
"There is no knowledge, that is not power"
fezh is offline
_Venganza_
Senior Member
Join Date: Apr 2011
Location: Valparaiso, Chile
Old 05-29-2011 , 15:56   Re: EngFunc_TraceToss
#2

Muy bueno el tuto pero en el video sale: El usuario ha suprimido este vídeo.
Disculpa las molestias.
_Venganza_ is offline
!Morte
Veteran Member
Join Date: May 2010
Old 05-29-2011 , 16:11   Re: EngFunc_TraceToss
#3

Quote:
Originally Posted by _Venganza_ View Post
Muy bueno el tuto pero en el video sale: El usuario ha suprimido este vídeo.
Disculpa las molestias.
Solo imaginate que donde va a golpear la granada aparecen chispas
__________________
First Zombie Class
[ZP] Zombie Class: Houndeye Zombie
Quote:
Originally Posted by lucas_7_94 View Post
tenes que saber pawn antes de intentar hacer algo digno.
!Morte is offline
Send a message via MSN to !Morte Send a message via Skype™ to !Morte
_Venganza_
Senior Member
Join Date: Apr 2011
Location: Valparaiso, Chile
Old 05-29-2011 , 19:35   Re: EngFunc_TraceToss
#4

Quote:
Originally Posted by !Morte View Post
Solo imaginate que donde va a golpear la granada aparecen chispas
Tengo poca imaginación u.u
Google imagenes no ayuda mucho >.<
_Venganza_ is offline
shinoda
Spanish Moderator
Join Date: Nov 2009
Location: ag_crossfire
Old 06-02-2011 , 22:14   Re: EngFunc_TraceToss
#5

PHP Code:
 engfuncEngFunc_TraceTossiEntIGNORE_MONSTERSiTrace ); 
pentToIgnore es el index de una entidad, creo que no acepta IGNORE_MONSTERS y similares.

Y si se obtiene el vector final, ¿Por qué usar Ham_Think y no FM_SetModel o Ham_Spawn ?
shinoda is offline
Send a message via MSN to shinoda Send a message via Skype™ to shinoda
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 06-02-2011 , 23:40   Re: EngFunc_TraceToss
#6

Quote:
Originally Posted by shinoda View Post
PHP Code:
 engfuncEngFunc_TraceTossiEntIGNORE_MONSTERSiTrace ); 
pentToIgnore es el index de una entidad, creo que no acepta IGNORE_MONSTERS y similares.

Y si se obtiene el vector final, ¿Por qué usar Ham_Think y no FM_SetModel o Ham_Spawn ?
por si algo se mete en el camino ?


pd:emm,eso tambien calcula el revote ?.
__________________
Destro- is offline
fearAR
Veteran Member
Join Date: Oct 2010
Old 06-03-2011 , 11:14   Re: EngFunc_TraceToss
#7

Las funciones registradas como Think de la entidad granada se ejecutan sucesivamente durante 1 segundo, por lo q siempre calcula todo el recorrido aunqe se cruze algo igual cambia.

Es asi q calculo todo el recorrido hasta:

PHP Code:
get_gametime() + Float:TiempoExplotaGranada

/*No se cuanto tarda uan granada en el aire hasta q explota, pero esa es su forma de calculo*/ 
Saludos
fearAR is offline
Send a message via MSN to fearAR
shinoda
Spanish Moderator
Join Date: Nov 2009
Location: ag_crossfire
Old 06-04-2011 , 13:40   Re: EngFunc_TraceToss
#8

Quote:
Originally Posted by Destro- View Post
por si algo se mete en el camino ?


pd:emm,eso tambien calcula el revote ?.
No, pero un Think es innecesario, sería mejor agregandole un Touch.
shinoda is offline
Send a message via MSN to shinoda Send a message via Skype™ to shinoda
Old 08-27-2011, 06:01
johnymac
This message has been deleted by shinoda.
 


Thread Tools
Display Modes

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 13:47.


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