Raised This Month: $ Target: $400
 0% 

[zp] campo de fuerza


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 06-26-2010 , 18:30   [zp] campo de fuerza
Reply With Quote #1

Soy nuevo en esto y en el foro
me pueden ayudar con esto?

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <zombieplague>
#include <hamsandwich>
#include <fakemeta_util>

#define PLUGIN "[ZP] Burbuja"
#define VERSION "3.0"
#define AUTHOR "Destro"

#define ONE_COLOR
#define CAMPO_TASK

//#define RANDOM_COLOR

#if defined ONE_COLOR
new Float:colour_force_shield[3] = { 255.0 , 255.0 , 255.0 }
#endif

new g_bubble_bomb[33]
new const model_grenade[] = "models/zombie_plague/v_auragren.mdl"
new const model[] = "models/zombie_plague/aura8.mdl"
new const w_model[] = "models/zombie_plague/w_aura.mdl"
new const entclas[] = "campo_grenade_forze"
new cvar_bubblepush
new register_touch

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd("BUBBLEBOMB", "give_item_bubble")
register_event("CurWeapon", "hook_curwpn", "be", "1=1", "2!29");
cvar_bubblepush = register_cvar("zp_bubble_push", "100.0")

register_touch(entclas, "player", "entity_touch")

}

public plugin_precache()
{
engfunc(EngFunc_PrecacheModel, model_grenade)
engfunc(EngFunc_PrecacheModel, model)
engfunc(EngFunc_PrecacheModel, w_model)
}

// Bubble Grenade Explosion
public bubble_explode(id)
{
// Get origin
static FloatriginF[3]
pev(id, pev_origin, originF)

// Create Blast
create_blast4(originF)

new attacker // variable attacker ( ataque )
attacker = pev(id, pev_owner)

g_bubble_bomb[attacker] = false

set_pcvar_num(cvar_flaregrenades,1)

// Create entitity
new iEntity = create_entity("info_target")

if(!is_valid_ent(iEntity)) // determinamos que la entidad esta en false
return PLUGIN_HANDLED

new Float: Origin[3] // origen
entity_get_vector(id, EV_VEC_origin, Origin)

entity_set_string(iEntity, EV_SZ_classname, entclas)

entity_set_vector(iEntity,EV_VEC_origin, Origin)
entity_set_model(iEntity,model)
entity_set_int(iEntity, EV_INT_solid, SOLID_TRIGGER)
entity_set_size(iEntity, Float: {-110.0, -110.0, -110.0}, Float: {110.0, 110.0, 110.0})
entity_set_int(iEntity, EV_INT_renderfx, kRenderFxGlowShell)
entity_set_int(iEntity, EV_INT_rendermode, kRenderTransAlpha)
entity_set_float(iEntity, EV_FL_renderamt, 50.0) //

engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_DLIGHT)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2])
write_byte(15)
write_byte(255)
write_byte(255)
write_byte(255)
write_byte(2)
write_byte(0)
message_end()

#if defined RANDOM_COLOR
if(is_valid_ent(iEntity))
{
new Float:vColor[3]

for(new i; i < 3; i++)
vColor[i] = random_float(0.0, 255.0) // color r, g, b

entity_set_vector(iEntity, EV_VEC_rendercolor, vColor)
}
#endif

#if defined ONE_COLOR
entity_set_vector(iEntity, EV_VEC_rendercolor, colour_force_shield)
#endif

#if defined CAMPO_TASK
set_task(60.0, "DeleteEntity", iEntity)
#endif

return PLUGIN_CONTINUE;
}

// Bubble Grenade: Yellow Blast
create_blast4(const FloatriginF[3])
{
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2])
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2]+385.0)
write_short(g_exploSpr)
write_byte(0)
write_byte(0)
write_byte(4)
write_byte(60)
write_byte(0)
write_byte(255)
write_byte(255)
write_byte(255)
write_byte(200)
write_byte(0)
message_end()

// Medium ring
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2])
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2]+470.0)
write_short(g_exploSpr)
write_byte(0)
write_byte(0)
write_byte(4)
write_byte(60)
write_byte(0)
write_byte(255)
write_byte(255)
write_byte(255)
write_byte(200)
write_byte(0)
message_end()

// Largest ring
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2])
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2]+555.0)
write_short(g_exploSpr)
write_byte(0)
write_byte(0)
write_byte(4)
write_byte(60)
write_byte(0)
write_byte(255)
write_byte(255)
write_byte(255)
write_byte(200)
write_byte(0)
message_end()
}

// Touch bomb bubble
public entity_touch(touched, toucher)
{

if(g_zombie[toucher] || g_nemesis[toucher])

new Float:pos_ptr[3], Float:pos_ptd[3], Float:push_power = get_pcvar_float(cvar_bubblepush)

pev(touched, pev_origin, pos_ptr)
pev(toucher, pev_origin, pos_ptd)

for(new i = 0; i < 3; i++)
{
pos_ptd[i] -= pos_ptr[i]
pos_ptd[i] *= push_power
}
set_pev(toucher, pev_velocity, pos_ptd)
set_pev(toucher, pev_impulse, pos_ptd)
}
}

// Hook bubble bomb
public hook_curwpn(id)
{
if(!is_user_alive(id))
return PLUGIN_CONTINUE;

if(g_bubble_bomb[id] && !g_zombie[id])
{
new wID = read_data(2)
if(wID == CSW_SMOKEGRENADE)
set_pev(id, pev_viewmodel2, model_grenade)
}

return PLUGIN_CONTINUE;
}

// Give bubble item
public give_item_bubble(id)
{
g_bubble_bomb[id] = true
give_item(id,"weapon_smokegrenade")
}

// Remove Entity
public DeleteEntity(entity)
{
if(is_valid_ent(entity )
remove_entity(entity)
}
}



En register_touch(entclas, "player", "entity_touch") tengo algun error?porq me lo marca cuando lo qiero copilar

Last edited by Destro-; 06-26-2010 at 18:51. Reason: me comfundi
Destro- is offline
 



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 14:50.


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