[INC] Entity resume v1.2
#1
Esto seria una version casi resumida de las entidades.

Lo que trataria es volver las cosas mas resumidas/cortas, por ejemplo al ves de hacer algo como:

Código PHP:
public entity_test(id)
{
    new 
target[33]
    
entity_get_string(iEntityEV_SZ_classnametarget32)
    
    
client_print(idprint_chat"Classname = %s"target)

Pasaria a ser algo asi:
Código PHP:
public entity_test_inc(id)
{
    
client_print(idprint_chat"Classname = %s"entity_get_classname(iEntity10))


O sino algo asi
Código PHP:
public entity_test_inc(id)
{
    new 
classname entity_get_classname(iEntity10)
    
client_print(idprint_chat"Classname = %s"classname)

INC:
Código:
#if defined _entityinc_included
  #endinput
#endif
#define _entityinc_included

/*        [By josue9243]            */

/* *Obtiene classname de una entidad de hasta 32 caracteres* */

native entity_get_classname(iEntity)
/*------------------------------------*/

/* *Setea classname a una entidad* */

native entity_set_classname(iEntity, classname[])
/*--------------------------------------------------------*/

/* *Obtiene target de una entidad de hasta 32 caracteres* */

native entity_get_target(iEntity, iLen)
/*---------------------------------*/

/* *Setea target a una entidad* */

native entity_set_target(iEntity, target[])
/*------------------------------*/

/* *Obtiene la entidad observada por el player* */

native entity_get_aiming(index, iEntity)
/*----------------------------------------------*/

/* *Obtiene el Angulo girado de la entidad* */

native entity_get_vangles(iEntity)
/*------------------------------------------*/

/* *Setea un Angulo definido por el player a la entidad* */

native entity_set_vangles(iEntity, Float:vAngles[3])
/*-------------------------------------------------------*/

/* Obtiene iUser de una entidad */

native entity_get_iuser(iEntity, slot)
/*------------------------------*/

/* Setea iuser en un slot definido */

native entity_set_iuser(iEntity, slot, iNum)
/*---------------------------------*/

/* Borra/elimina la entidad */

native entity_remove(iEntity)
/*--------------------------*/

/* Setea SUBMODEL a una entidad */

native entity_set_submodel(iEntity, Submodel_Num)
/*--------------------------*/

/* Setea SKIN a una entidad */

native entity_set_skin(iEntity, Skin_Num)
/*--------------------------*/

/* Setea una Secuencia a una entidad */

native entity_set_secuence(iEntity, Secuence)
/*--------------------------*/

/* Busca classname de una entidad */

native entity_find_classname(classname[])
/*--------------------------*/

/* Setea RENDERMODE a una entidad */

native entity_set_rendermode(iEntity, rendermode)
/*--------------------------*/

Plugin que viene con el inc:
Código PHP:
#include <amxmodx>
#include <engine>
#include <fakemeta>

public plugin_init() {
    
register_plugin("core_entity""v1.2""Josue Alonso")
}

public 
plugin_natives(){
    
register_native("entity_get_classname""native_entity_get_classname"1)
    
register_native("entity_set_classname""native_entity_set_classname"1)
    
register_native("entity_get_target""native_entity_get_target"1)
    
register_native("entity_set_target""native_entity_set_target"1)
    
register_native("entity_get_origin""native_entity_get_origin"1)
    
register_native("entity_get_aiming""native_entity_get_aiming"1)
    
register_native("entity_get_vangles""native_entity_get_vangles"1)
    
register_native("entity_set_vangles""native_entity_set_vangles"1)
    
register_native("entity_get_iuser""native_entity_get_iuser"1)
    
register_native("entity_set_iuser""native_entity_set_iuser"1)
    
register_native("entity_remove""native_entity_remove"1)
    
register_native("entity_set_submodel""native_entity_set_submodel"1)
    
register_native("entity_set_skin""native_entity_set_skin"1)
    
register_native("entity_set_secuence""native_entity_set_secuence"1)
    
register_native("entity_find_classname""native_entity_find_classname"1)
    
register_native("entity_set_rendermode""native_entity_set_rendermode"1)
    
register_native("entity_set_glow""native_entity_set_glow"1)
}

public 
native_entity_get_classname(iEntity)
{
    new 
classname[33];entity_get_string(iEntityEV_SZ_classnameclassname32)
    return 
classname;
}

public 
native_entity_set_classname(iEntityclassname[])
{
    
entity_set_string(iEntityEV_SZ_classnameclassname)
}

public 
native_entity_get_target(iEntity)
{
    new 
target[33];entity_get_string(iEntityEV_SZ_targettarget32)
    return 
target;
}

public 
native_entity_set_target(iEntitytarget[])
{
    
entity_set_string(iEntityEV_SZ_targettarget)
}

public 
native_entity_get_origin(iEntity)
{
    new 
Float:iOriginF[3]
    return 
entity_get_vector(iEntityEV_VEC_originiOriginF);


public 
native_entity_get_aiming(indexiEntity)
{
    new 
body;get_user_aiming(indexiEntitybody)
    return 
iEntity;
}

public 
native_entity_get_vangles(iEntity){
    new 
Float:vAngles[3];
    return 
entity_get_vector(iEntityEV_VEC_anglesvAngles);
}

public 
native_entity_set_vangles(iEntityFloat:vAngles[3])
{
    
entity_set_vector(iEntityEV_VEC_anglesvAngles);
}

public 
native_entity_get_iuser(iEntityslot)
{
    switch(
slot)
    {
        case 
1entity_get_int(iEntityEV_INT_iuser1);
        case 
2entity_get_int(iEntityEV_INT_iuser2);
        case 
3entity_get_int(iEntityEV_INT_iuser3);
        case 
4entity_get_int(iEntityEV_INT_iuser4);
    }
}

public 
native_entity_set_iuser(iEntityslotiNum)
{
    switch(
slot)
    {
        case 
1entity_set_int(iEntityEV_INT_iuser1iNum)
        case 
2entity_set_int(iEntityEV_INT_iuser2iNum)
        case 
3entity_set_int(iEntityEV_INT_iuser3iNum)
        case 
4entity_set_int(iEntityEV_INT_iuser4iNum)
    }
}

public 
native_entity_remove(iEntity)
{
    
remove_entity(iEntity)
}

public 
native_entity_set_submodel(iEntitySubmodel_Num)
{
    
set_pev(iEntitypev_bodySubmodel_Num)
}

public 
native_entity_set_skin(iEntitySkin_Num)
{
    
set_pev(iEntitypev_skinSkin_Num)
}

public 
native_entity_set_secuence(iEntitySecuence)
{
    
entity_set_int(iEntityEV_INT_sequenceSecuence)
}

public 
native_entity_find_classname(classname[])
{
    new 
iEntfinder FM_NULLENT
    
if((iEntfinder engfunc(EngFunc_FindEntityByStringiEntfinder"classname"classname)))
    {
        return 
iEntfinder
    
}
    
    return 
PLUGIN_CONTINUE;
}

public 
native_entity_set_rendermode(iEntityrendermode)
{
    
entity_set_int(iEntityEV_INT_rendermoderendermode)


Cualquier duda o consulta o algo para agregar, ponganlo en los comentarios.


- v1.2 Se agregaron 5 funciones mas, y se arreglaron bugs.


Archivos adjuntos
.sma   Descargar AMXX / entitycore.sma (Tamaño: 3.86 KB / Descargas: 97)
.inc   entityinc.inc (Tamaño: 2.04 KB / Descargas: 10)
Responder
#2
._. a donde vamos a parar ? (8) Nothingdohere
[Imagen: bvpq9q-6.png]

NO DOY AYUDA VIA MENSAJE PRIVADO

* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Responder
#3
(26/10/2015, 09:17 PM)kikizon2 escribió: ._. a donde vamos a parar ? (8) Nothingdohere

OFF: No sé yo vengo de la escuela y estoy sentado todo el dia. Yao ming

ON: A que te referis? Oh god why
Responder
#4
Agrega lo siguiente al inicio del *.INC
Código:
#if defined _entityinc_included
  #endinput
#endif
#define _entityinc_included

Eso evita futuros problemas/errores cuando se registra dos veces el mismo include.
[Imagen: b_350_20_323957_202743_f19a15_111111.png]

Estudia siempre; el tiempo es oro, lo material se puede recuperar pero el tiempo no se puede recuperar.
(02/10/2016, 05:05 PM)meTaLiCroSS escribió: Siempre me gusta ayudar cuando alguien esta interesado realmente en ver que esta programando.
(08/08/2019, 05:32 PM)meTaLiCroSS escribió: grax x el dato cr4ck


Mis aportes

PLUGINS
MAPAS
Menú LANG [SF] Sistema de Frags
Say System (Admin Prefix)
Responder
#5
(26/10/2015, 09:18 PM)totopizza escribió: Agrega lo siguiente al inicio del *.INC
Código:
#if defined _entityinc_included
  #endinput
#endif
#define _entityinc_included

Eso evita futuros problemas/errores cuando se registra dos veces el mismo include.

Como registrar 2 veces el plugin?, eso lo vi en el inc adv_vault de destro pero no sabia para que servia poreso no lo agrege.

(Ejemplo de registrarlo 2 veces?).

EDIT: Ya entendi :p, Gracias!.

PD: Ya lo agrege
Responder
#6
Código PHP:
#include <amxmod>
#include <mi_include>//Registro el include
#include <mi_include>//Registré por segunda ves el include! 
[Imagen: b_350_20_323957_202743_f19a15_111111.png]

Estudia siempre; el tiempo es oro, lo material se puede recuperar pero el tiempo no se puede recuperar.
(02/10/2016, 05:05 PM)meTaLiCroSS escribió: Siempre me gusta ayudar cuando alguien esta interesado realmente en ver que esta programando.
(08/08/2019, 05:32 PM)meTaLiCroSS escribió: grax x el dato cr4ck


Mis aportes

PLUGINS
MAPAS
Menú LANG [SF] Sistema de Frags
Say System (Admin Prefix)
Responder
#7
buen aporte pacman
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#8
ok, si te soy sincero, no tengo la mas minima y remota idea para que pueda ser de utilidad puedo decir que
Código PHP:
set_pdata_ini(id1215
es mas util postear pa'que coño sirve que esa api ._.

te voy a dar un par de tips:
-si vas a aportar algun stock sobre entidades hazlo de fakemeta por ya de engine sabemos mucho ( igual con el fake )
-cuando lo hagas aporta algo que se usa muy escasas veces por el simple hecho que no muchos lo sabemos emplear bien (Ejemplo perfecto seria AddToFullPack, CmdStart, CmdEnd u otra paja)
Competitive/Face it Pick Up Game (PUG) servidor de prueba: 45.77.94.109:27016 Click para Entrar
[Imagen: b_350_20_5A6C3E_383F2D_D2E1B5_2E3226.png]

(14/08/2015, 10:15 PM)Sugisaki escribió: "El mundo es caotico, irracional e injusto. No tiene ningun significado"
Palabras que desde hace mucho tiempo he buscado para describir, ¿Que es el mundo?
Crab

Código PHP:
if(ayuda && free)
{
    exit();

Responder
#9
(27/10/2015, 12:55 AM)Sugisaki escribió: ok, si te soy sincero, no tengo la mas minima y remota idea para que pueda ser de utilidad puedo decir que
Código PHP:
set_pdata_ini(id1215
es mas util postear pa'que coño sirve que esa api ._.

te voy a dar un par de tips:
-si vas a aportar algun stock sobre entidades hazlo de fakemeta por ya de engine sabemos mucho ( igual con el fake )
-cuando lo hagas aporta algo que se usa muy escasas veces por el simple hecho que no muchos lo sabemos emplear bien (Ejemplo perfecto seria AddToFullPack, CmdStart, CmdEnd u otra paja)

Lo tendre en cuenta pacman, este inc lo que hace es resumir cosas al ves de estar escribiendo todos los parametros para tener algun origin o classname, esto lo acorta...

Ya di ejemplos en el post que vos no los quieras leer es otra cosa, ahora me diste la idea de cmdstart, voy a ver que onda y voy a ver si puedo hacer algo.
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)