AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Vexd Rocket (https://forums.alliedmods.net/showthread.php?t=9967)

Extremeone 02-05-2005 07:38

Vexd Rocket
 
OK this was attempted b4 but to my knowledge never finished i am having some trouble finishing it

so currently i have this sma
Code:
#include <amxmodx> #include <amxmisc> #include <engine> new beam, boom public vexd_pfntouch(pToucher, pTouched) {     new szClassName[32]     entity_get_string(pToucher, EV_SZ_classname, szClassName, 32);     if(equal(szClassName, "vexd_rocket")) {         emit_sound(pToucher, CHAN_WEAPON, "vox/_period.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         emit_sound(pToucher, CHAN_VOICE, "vox/_period.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         new Float:vExplodeAt[3]         entity_set_vector(pToucher, EV_VEC_origin, vExplodeAt)         RadiusDamage(vExplodeAt, 1)         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)         write_byte(3)         write_coord(floatround(vExplodeAt[0]))         write_coord(floatround(vExplodeAt[1]))         write_coord(floatround(vExplodeAt[2]))         write_short(boom)         write_byte(50)         write_byte(15)         write_byte(0)         message_end()         new iOwner         iOwner = entity_get_edict(pToucher, EV_ENT_owner)         Attach_View(iOwner, iOwner)    //Resets rocket owner's view (in case of vrocket).         Remove_Entity (pToucher)     }     return 1; } public Vexd_CreateRocket(id,level,cid){     if (!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED     new Float:vOrigin[3]     new Float:vAngles[3]     entity_get_vector(id, EV_VEC_origin, vOrigin)     entity_get_vector(id, EV_VEC_v_angle, vAngles)         new NewEnt         NewEnt = Create_Entity("info_target")         if(NewEnt == 0) {             return PLUGIN_HANDLED_MAIN         }     entity_set_string(NewEnt, EV_SZ_classname, "vexd_rocket")         entity_set_model(NewEnt, "models/rpgrocket.mdl")     new Float:MinBox[3]     new Float:MaxBox[3]     MinBox[0] = -1.0     MinBox[1] = -1.0     MinBox[2] = -1.0     MaxBox[0] = 1.0     MaxBox[1] = 1.0     MaxBox[2] = 1.0     entity_set_vector(NewEnt, EV_VEC_mins, MinBox)     entity_set_vector(NewEnt, EV_VEC_maxs, MaxBox)     entity_set_origin(NewEnt, vOrigin)     entity_set_vector(NewEnt, EV_VEC_angles, vAngles)     entity_set_int(NewEnt, EV_INT_effects, 64)  //64 = EF_LIGHT, rocket glow. 64??     entity_set_int(NewEnt, EV_INT_solid, 2)    //2 = Solid bbox. (const.h)     entity_set_int(NewEnt, EV_INT_movetype, 5) //5 = movetype_fly, No grav, but collides.     entity_set_edict(NewEnt, EV_ENT_owner, id)     new Float:fNewVelocity[3]     VelocityByAim(id, 400, fNewVelocity)     entity_set_vector(NewEnt, EV_VEC_velocity, fNewVelocity)     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)     write_byte(22)     write_short(NewEnt)     write_short(beam)     write_byte(45)     write_byte(4)     write_byte(255)     write_byte(0)     write_byte(0)     write_byte(128)     message_end()     emit_sound(NewEnt, CHAN_WEAPON, "weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)     emit_sound(NewEnt, CHAN_VOICE, "weapons/rocket1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)     return PLUGIN_HANDLED_MAIN } public Vexd_CreateVRocket(id,level,cid){     if (!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED     new Float:vOrigin[3]     new Float:vAngles[3]     entity_get_vector(id, EV_VEC_origin, vOrigin)     entity_get_vector(id, EV_VEC_v_angle, vAngles)         new NewEnt         NewEnt = Create_Entity("info_target")         if(NewEnt == 0) {             return PLUGIN_HANDLED_MAIN         }     entity_set_string(NewEnt, EV_SZ_classname, "vexd_rocket")         entity_set_model(NewEnt, "models/rpgrocket.mdl")     new Float:MinBox[3]     new Float:MaxBox[3]     MinBox[0] = -1.0     MinBox[1] = -1.0     MinBox[2] = -1.0     MaxBox[0] = 1.0     MaxBox[1] = 1.0     MaxBox[2] = 1.0     entity_set_vector(NewEnt, EV_VEC_mins, MinBox)     entity_set_vector(NewEnt, EV_VEC_maxs, MaxBox)     entity_set_origin(NewEnt, vOrigin)     entity_set_vector(NewEnt, EV_VEC_angles, vAngles)     entity_set_int(NewEnt, EV_INT_effects, 1)  //1 = EF_LIGHT, rocket glow. 64??     entity_set_int(NewEnt, EV_INT_solid, 2)    //2 = Solid bbox. (const.h)     entity_set_int(NewEnt, EV_INT_movetype, 5) //5 = movetype_fly, No grav, but collides.     entity_set_edict(NewEnt, EV_ENT_owner, id)     new Float:fNewVelocity[3]     VelocityByAim(id, 400, fNewVelocity)     entity_set_vector(NewEnt, EV_VEC_velocity, fNewVelocity)     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)     write_byte(22)     write_short(NewEnt)     write_short(beam)     write_byte(45)     write_byte(4)     write_byte(255)     write_byte(0)     write_byte(0)     write_byte(128)     message_end()     emit_sound(NewEnt, CHAN_WEAPON, "weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)     emit_sound(NewEnt, CHAN_VOICE, "weapons/rocket1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)     Attach_View(id, NewEnt)     return PLUGIN_HANDLED_MAIN } public plugin_init(){     register_plugin("Vexd Entity demo (Rocket)","1.00","default")     register_concmd("amx_rocket","Vexd_CreateRocket",ADMIN_KICK)     register_concmd("amx_vrocket","Vexd_CreateVRocket",ADMIN_KICK)     return PLUGIN_CONTINUE } public plugin_precache() {     precache_sound("vox/_period.wav")     precache_sound("weapons/rocketfire1.wav")     precache_sound("weapons/rocket1.wav")     precache_model("models/rpgrocket.mdl")     beam = precache_model("sprites/laserbeam.spr")     boom = precache_model("sprites/zerogxplode.spr")     return PLUGIN_CONTINUE }

that gives these errors
Code:

./include/engine_stocks.inc(262) : error 032: array index out of bounds (variable "fExplodeAt")
/home/users/amxmodx/tmp/Tzp8BHdr.sma(18) : warning 202: number of arguments does not match definition
/home/users/amxmodx/tmp/Tzp8BHdr.sma(34) : error 017: undefined symbol "Attach_View"
/home/users/amxmodx/tmp/Tzp8BHdr.sma(36) : error 017: undefined symbol "Remove_Entity"
/home/users/amxmodx/tmp/Tzp8BHdr.sma(51) : warning 217: loose indentation
/home/users/amxmodx/tmp/Tzp8BHdr.sma(52) : error 017: undefined symbol "Create_Entity"
/home/users/amxmodx/tmp/Tzp8BHdr.sma(58) : warning 217: loose indentation
/home/users/amxmodx/tmp/Tzp8BHdr.sma(60) : warning 217: loose indentation
/home/users/amxmodx/tmp/Tzp8BHdr.sma(62) : warning 217: loose indentation
/home/users/amxmodx/tmp/Tzp8BHdr.sma(114) : warning 217: loose indentation
/home/users/amxmodx/tmp/Tzp8BHdr.sma(115) : error 017: undefined symbol "Create_Entity"
/home/users/amxmodx/tmp/Tzp8BHdr.sma(121) : warning 217: loose indentation
/home/users/amxmodx/tmp/Tzp8BHdr.sma(123) : warning 217: loose indentation
/home/users/amxmodx/tmp/Tzp8BHdr.sma(125) : warning 217: loose indentation
/home/users/amxmodx/tmp/Tzp8BHdr.sma(166) : error 017: undefined symbol "Attach_View"


XxAvalanchexX 02-05-2005 12:26

That's an old AMX(notx) plugin. One of the radius damage functions has changed, so that's where you get the wrong number of parameters. The missing functions are because they are using old function names. If you #include <Vexd_Utilities> then that will provide most of the backwards-compatabilty that you need. That'll still leave you with loose indentations and an out-of-bounds error, most likely. We're not here to do it all for you. :-P

Extremeone 02-05-2005 12:35

hmmmm including vexd ultilities fixed the out of bounds and nothing else :?


All times are GMT -4. The time now is 19:18.

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