Raised This Month: $ Target: $400
 0% 

need some help porting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 08-22-2006 , 03:38   need some help porting
Reply With Quote #1

hey guys i just found this in the amx forums and i would like to port it but i don't know alot about engine and fm so could someone plz help me?
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 <engine> #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") } public set_model(entity, const model[]) {   if(get_cvar_num("amx_changenadesfusetime") == 1) {     if(is_entity(entity) && entity_get_int(entity, EV_INT_movetype) == MOVETYPE_BOUNCE) {       if(equal(model, g_heModel)) {         entity_set_float(entity, EV_FL_dmgtime, get_gametime() + get_cvar_float("amx_he_fusetime"))       }       else if(equal(model, g_fbModel)) {         entity_set_float(entity, EV_FL_dmgtime, get_gametime() + get_cvar_float("amx_fb_fusetime"))       }       else if(equal(model, g_sgModel)) {         entity_set_float(entity, EV_FL_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 && find_entity(id, "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 = find_entity_sphere(id, g_fEnd, NADE_RADIUS)     while(ent > 0) {       if(entity_get_float(ent, EV_FL_dmgtime) > get_gametime()) {         model[0] = '^0'         entity_get_string(ent, EV_SZ_model, model, 63)         if(equal(model, g_heModel) || equal(model, g_fbModel) || equal(model, g_sgModel)) {           entity_set_float(ent, EV_FL_dmgtime, get_gametime()-0.1)           g_lastwpn[id] = wpn           g_lastammo[id] = ammo           return PLUGIN_CONTINUE         }       }       ent = find_entity_sphere(ent, g_fEnd, NADE_RADIUS)     }     g_distance = vector_distance(g_fStart, g_fEnd)     if(g_distance > STEP) {       VelocityByAim(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 = find_entity_sphere(id, g_fStart, NADE_RADIUS)         while(ent > 0) {           if(entity_get_float(ent, EV_FL_dmgtime) > get_gametime()) {             model[0] = '^0'             entity_get_string(ent, EV_SZ_model, model, 63)             if(equal(model, g_heModel) || equal(model, g_fbModel) || equal(model, g_sgModel)) {               entity_set_float(ent, EV_FL_dmgtime, get_gametime()-0.1)               g_lastwpn[id] = wpn               g_lastammo[id] = ammo               return PLUGIN_CONTINUE             }           }           ent = find_entity_sphere(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 }
k007 is offline
Send a message via MSN to k007
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 #2

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
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 08-22-2006 , 09:20   Re: need some help porting
Reply With Quote #3

fakemeta > engine.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 08-22-2006 , 11:20   Re: need some help porting
Reply With Quote #4

Quote:
Originally Posted by SweatyBanana View Post
fakemeta > engine.
I already know this. If I wanted to code this in fakemeta I would of.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 08-22-2006 , 11:56   Re: need some help porting
Reply With Quote #5

PS: Krotal asked for his plugins not to be ported to amxmodx.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 08-22-2006 , 12:21   Re: need some help porting
Reply With Quote #6

Quote:
Originally Posted by SweatyBanana View Post
PS: Krotal asked for his plugins not to be ported to amxmodx.
Doesn't matter to me. The plugin is under GNU General Public License. His plugins might not be posted by me in a plugin submission. You can modify any plugin you want.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
KRoT@L
Member
Join Date: Aug 2004
Location: http://www.amxmod.net
Old 08-22-2006 , 12:27   Re: need some help porting
Reply With Quote #7

Tell that to Hawk mouahahaha.
And you can't convert this plugin to amxx without fakemeta.
__________________
AMX MOD >>> AMX MOD X.
Get Down or Lay Down.
(Thanks for the sig. Freecode)


[IMG]http://img91.**************/img91/1686/firethefox4ud.gif[/IMG]

Last edited by KRoT@L; 08-22-2006 at 12:29.
KRoT@L is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 08-22-2006 , 13:21   Re: need some help porting
Reply With Quote #8

thx teame06 ill go try it out
k007 is offline
Send a message via MSN to k007
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 08-22-2006 , 13:23   Re: need some help porting
Reply With Quote #9

@ k007

Yea it won't work right now. I'll port this to full fakemeta alittle later since it need fakemeta for the forward Set Model.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 08-22-2006 , 13:32   Re: need some help porting
Reply With Quote #10

ok ty
k007 is offline
Send a message via MSN to k007
Reply


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


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