Raised This Month: $ Target: $400
 0% 

need some help porting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 08-22-2006 , 03:51   Re: need some help porting
Reply With Quote #1

You didn't need to include both fakemeta and engine. use one or the other. This was done in engine. It compile with no errors.

Code:
/******************************************************************************* Shoot At Nades Author: KRoTaL Version: 1.0 1.0    Release If you shoot at a nade (HE, FlashBang or SmokeGrenade), it will explode. You can set also change the fuse time of each nade. Cvars: amx_shootatnades "1"  -  0: you can't shoot at nades 1: you can shoot at nades amx_changenadesfusetime "1"  -  0: default fuse time 1: fuse time is set according to the values of the following cvars amx_he_fusetime "5.0"  -  number of seconds before HE eplosion amx_fb_fusetime "5.0"  -  number of seconds before FlashBang eplosion amx_sg_fusetime "5.0"  -  number of seconds before Smoke Grenade eplosion Setup: Install the amx file. Enable VexdUM. *******************************************************************************/ #include <amxmodx> #include <amxmisc> #include <fakemeta> #define STEP 40.0 #define NADE_RADIUS 20.0 new g_lastwpn[33] new g_lastammo[33] new g_iStart[3], g_iEnd[3] new Float:g_fStart[3], Float:g_fEnd[3] new Float:g_distance new Float:g_fVel[3] new g_heModel[] = "models/w_hegrenade.mdl" new g_fbModel[] = "models/w_flashbang.mdl" new g_sgModel[] = "models/w_smokegrenade.mdl" public plugin_init() {     register_plugin("Shoot At Nades", "1.0", "KRoTaL")     register_cvar("amx_shootatnades", "1")     register_cvar("amx_changenadesfusetime", "1")     register_cvar("amx_he_fusetime", "5.0")     register_cvar("amx_fb_fusetime", "5.0")     register_cvar("amx_sg_fusetime", "5.0")     register_event("CurWeapon", "eventCurWeapon", "be", "1=1", "3>0")     register_forward(FM_SetModel, "set_model"); } public set_model(entity, const model[]) {     if(get_cvar_num("amx_changenadesfusetime") == 1) {         if(pev_valid(entity) && pev(entity, pev_movetype) == MOVETYPE_BOUNCE) {             if(equal(model, g_heModel)) {                 set_pev(entity, pev_dmgtime, get_gametime() + get_cvar_float("amx_he_fusetime"))             }             else if(equal(model, g_fbModel)) {                 set_pev(entity, pev_dmgtime, get_gametime() + get_cvar_float("amx_fb_fusetime"))             }             else if(equal(model, g_sgModel)) {                 set_pev(entity, pev_dmgtime, get_gametime() + get_cvar_float("amx_sg_fusetime"))             }         }     }     return PLUGIN_CONTINUE } public eventCurWeapon(id) {     new wpn = read_data(2)     new ammo = read_data(3)     if(get_cvar_num("amx_shootatnades") == 1 && engfunc(EngFunc_FindEntityByString, id, "classname", "grenade") > 0 && g_lastwpn[id] == wpn && g_lastammo[id] > ammo)     {         get_user_origin(id, g_iStart, 1)         get_user_origin(id, g_iEnd, 4)         _IVecFVec(g_iStart, g_fStart)         _IVecFVec(g_iEnd, g_fEnd)         new model[64]         new ent = engfunc(EngFunc_FindEntityInSphere, id, g_fEnd, NADE_RADIUS)         while(ent > 0) {             if(pev(ent, pev_dmgtime) > get_gametime()) {                 model[0] = '^0'                 pev(ent, pev_model, model, 63)                 if(equal(model, g_heModel) || equal(model, g_fbModel) || equal(model, g_sgModel)) {                     set_pev(ent, pev_dmgtime, get_gametime()-0.1)                     g_lastwpn[id] = wpn                     g_lastammo[id] = ammo                     return PLUGIN_CONTINUE                 }             }             ent = engfunc(EngFunc_FindEntityInSphere, ent, g_fEnd, NADE_RADIUS)         }         g_distance = vector_distance(g_fStart, g_fEnd)         if(g_distance > STEP) {             velocity_by_aim(id, floatround(STEP), g_fVel)             new iStop=0             do {                 g_fStart[0] += g_fVel[0]                 g_fStart[1] += g_fVel[1]                 g_fStart[2] += g_fVel[2]                 ent = engfunc(EngFunc_FindEntityInSphere, id, g_fStart, NADE_RADIUS)                 while(ent > 0) {                     if(pev(ent, pev_dmgtime) > get_gametime()) {                         model[0] = '^0'                         pev(ent, pev_model, model, 63)                         if(equal(model, g_heModel) || equal(model, g_fbModel) || equal(model, g_sgModel)) {                             set_pev(ent, pev_dmgtime, get_gametime()-0.1)                             g_lastwpn[id] = wpn                             g_lastammo[id] = ammo                             return PLUGIN_CONTINUE                         }                     }                     ent = engfunc(EngFunc_FindEntityInSphere, ent, g_fEnd, NADE_RADIUS)                 }                 iStop++             } while(vector_distance(g_fStart, g_fEnd) > (STEP*1.5) && (iStop < 100))         }     }     g_lastwpn[id] = wpn     g_lastammo[id] = ammo     return PLUGIN_CONTINUE } // This is in engine_stocks .. If you do an #include <engine_stocks> It will include #include <engine> for you. stock _IVecFVec(IVec[3], Float:FVec[3]) {     FVec[0] = float(IVec[0])     FVec[1] = float(IVec[1])     FVec[2] = float(IVec[2])     return 1 }
__________________
No private support via Instant Message
GunGame:SM Released

Last edited by teame06; 08-22-2006 at 19:24.
teame06 is offline
Send a message via AIM to teame06
Reply



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 09:46.


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