Raised This Month: $ Target: $400
 0% 

Rocket plugin help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 04-09-2004 , 00:08   Rocket plugin help
Reply With Quote #1

Im trying to make a plugin that allows you to fire rockets, but im getting some errors... heres the code:

Code:
//////////////////// #include <amxmodx> #include <engine> //////////////////// new float:pOrigin[3] new float:AimOrigin[33][3] new OwnerID, Fire //////////////////// public plugin_init() {     register_plugin("RPG Rocket","0.1","knekter")     register_clcmd("fire_rocket","rocket_init") } public plugin_precache() {     precache_model("models/rpgrocket.mdl")     Fire = precache_model("sprites/fire.spr")     return PLUGIN_CONTINUE } ///////////////////// public rocket_init(id) {     new rocketID     rocketID = create_entity("info_target")     if(rocketID == 0)         return PLUGIN_CONTINUE     entity_set_string(rocketID,EV_SZ_classname,"RPG Rocket")     entity_set_model(rocketID,"models/rpgrocket.mdl")     entity_get_vector(id,EV_VEC_origin,pOrigin)     entity_set_origin(rocketID,pOrigin)     entity_set_int(rocketID,EV_INT_solid,1)     entity_set_int(rocketID,EV_INT_movetype,6)     OwnerID = entity_set_edict(rocketID,EV_ENT_owner,id)     get_user_origin(id,AimOrigin[id],3)     new pID[2]     pID[0] = id     set_task(0.1,"rocket_fired",0,pID,1)     return PLUGIN_CONTINUE } rocket_fired(pID[0]) {     if(pOrigin[0] > AimOrigin[id][0])     {         pOrigin[0] = (pOrigin[0] + 0.1)     }     if(pOrigin[0] < AimOrigin[id][0])     {         pOrigin[0] = (pOrigin[0] - 0.1)     }     if(pOrigin[1] > AimOrigin[id][1])     {         pOrigin[1] = (pOrigin[1] + 0.1)     }     if(pOrigin[1] < AimOrigin[id][1])     {         pOrigin[1] = (pOrigin[1] - 0.1)     }     if(pOrigin[2] > AimOrigin[id][2])     {         pOrigin[2] = (pOrigin[2] + 0.1)     }     if(pOrigin[0] < AimOrigin[id][2])     {         pOrigin[2] = (pOrigin[2] - 0.1)     }     set_task(0.2,"rocket_fired",0,pID,1)     return PLUGIN_CONTINUE } public pfn_touch(ptr,ptd) {     OwnerID = entity_get_edict(ptd,EV_ENT_owner)     if(ptr == OwnerID)     {         return PLUGIN_CONTINUE     }     else     {         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)         write_byte(3)         write_coord(AimOrigin[ptr][0])         write_coord(AimOrigin[ptr][1])         write_coord(AimOrigin[ptr][2])         write_short(Fire)         write_byte(20)         write_byte(5)         write_byte(0)         message_end()     }     return PLUGIN_CONTINUE }

Ive never attempted this before, so im at my trial and error stage heres my errors:

Code:
rpg.sma(30) : warning 213: tag mismatch
rpg.sma(31) : warning 213: tag mismatch
rpg.sma(91) : warning 203: symbol is never used: "rocket_fired"

Press any key to continue . . .
plz help me out, and dont say this:
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
dragonchaos
Member
Join Date: Mar 2004
Old 04-09-2004 , 09:31  
Reply With Quote #2

Code:
    if(pOrigin[0] > AimOrigin[pID[0]][0])     {         pOrigin[0] = (pOrigin[0] + 0.1)     }     if(pOrigin[0] < AimOrigin[pID[0]][0])     {         pOrigin[0] = (pOrigin[0] - 0.1)     }     if(pOrigin[1] > AimOrigin[pID[0]][1])     {         pOrigin[1] = (pOrigin[1] + 0.1)     }     if(pOrigin[1] < AimOrigin[pID[0]][1])     {         pOrigin[1] = (pOrigin[1] - 0.1)     }     if(pOrigin[2] > AimOrigin[pID[0]][2])     {         pOrigin[2] = (pOrigin[2] + 0.1)     }     if(pOrigin[0] < AimOrigin[pID[0]][2])     {         pOrigin[2] = (pOrigin[2] - 0.1)     }

I think you mean this, where id is supposed to be pID[0], other than that I dont have the includes in front of me so I can't tell you about the tag mismatch error, what it means is that you either added an extra tag in the function call or had an integer instead of a float, or did not have enough tags in the function.
dragonchaos is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 04-09-2004 , 11:11   hmmm
Reply With Quote #3

thx, I just need to figure out why it syas tag mismatch ...
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 04-09-2004 , 11:38  
Reply With Quote #4

make rocket_fired a public
Freecode is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 04-09-2004 , 18:21   hmmm
Reply With Quote #5

I did what you said freecode, but now I get more warnings PLZ HELP!

Code:
//////////////////// #include <amxmodx> #include <engine> //////////////////// new float:pOrigin[3] new float:AimOrigin[33][3] new OwnerID, Fire //////////////////// public plugin_init() {     register_plugin("RPG Rocket","0.1","knekter")     register_clcmd("fire_rocket","rocket_init") } public plugin_precache() {     precache_model("models/rpgrocket.mdl")     Fire = precache_model("sprites/fire.spr")     return PLUGIN_CONTINUE } ///////////////////// public rocket_init(id) {     new rocketID     rocketID = create_entity("info_target")     if(rocketID == 0)         return PLUGIN_CONTINUE     entity_set_string(rocketID,EV_SZ_classname,"RPG Rocket")     entity_set_model(rocketID,"models/rpgrocket.mdl")     entity_get_vector(id,EV_VEC_origin,pOrigin)     entity_set_origin(rocketID,pOrigin)     entity_set_int(rocketID,EV_INT_solid,1)     entity_set_int(rocketID,EV_INT_movetype,6)     OwnerID = entity_set_edict(rocketID,EV_ENT_owner,id)     get_user_origin(id,AimOrigin[id],3)     new pID[2]     pID[0] = id     set_task(0.1,"rocket_fired",0,pID,1)     return PLUGIN_CONTINUE } public rocket_fired(pID[0]) {     if(pOrigin[0] > AimOrigin[pID[0]][0])     {         pOrigin[0] = (pOrigin[0] + 0.1)     }     if(pOrigin[0] < AimOrigin[pID[0]][0])     {         pOrigin[0] = (pOrigin[0] - 0.1)     }     if(pOrigin[1] > AimOrigin[pID[0]][1])     {         pOrigin[1] = (pOrigin[1] + 0.1)     }     if(pOrigin[1] < AimOrigin[pID[0]][1])     {         pOrigin[1] = (pOrigin[1] - 0.1)     }     if(pOrigin[2] > AimOrigin[pID[0]][2])     {         pOrigin[2] = (pOrigin[2] + 0.1)     }     if(pOrigin[0] < AimOrigin[pID[0]][2])     {         pOrigin[2] = (pOrigin[2] - 0.1)     }     set_task(0.2,"rocket_fired",0,pID,1)     return PLUGIN_CONTINUE } public pfn_touch(ptr,ptd) {     OwnerID = entity_get_edict(ptd,EV_ENT_owner)     if(ptr == OwnerID)     {         return PLUGIN_CONTINUE     }     else     {         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)         write_byte(3)         write_coord(AimOrigin[ptr][0])         write_coord(AimOrigin[ptr][1])         write_coord(AimOrigin[ptr][2])         write_short(Fire)         write_byte(20)         write_byte(5)         write_byte(0)         message_end()     }     remove_task(OwnerID)     return PLUGIN_CONTINUE }

Code:
rpg.sma(30) : warning 213: tag mismatch
rpg.sma(31) : warning 213: tag mismatch
rpg.sma(45) : warning 213: tag mismatch
rpg.sma(45 -- 46) : warning 213: tag mismatch
rpg.sma(49) : warning 213: tag mismatch
rpg.sma(53) : warning 213: tag mismatch
rpg.sma(53 -- 54) : warning 213: tag mismatch
rpg.sma(57) : warning 213: tag mismatch
rpg.sma(61) : warning 213: tag mismatch
rpg.sma(61 -- 62) : warning 213: tag mismatch
rpg.sma(65) : warning 213: tag mismatch
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-09-2004 , 20:36  
Reply With Quote #6

Code:
//////////////////// #include <amxmodx> #include <engine> //////////////////// new Float:pOrigin[3] new AimOrigin[33][3] new OwnerID, Fire //////////////////// public plugin_init() {     register_plugin("RPG Rocket","0.1","knekter")     register_clcmd("fire_rocket","rocket_init") } public plugin_precache() {     precache_model("models/rpgrocket.mdl")     Fire = precache_model("sprites/fire.spr")     return PLUGIN_CONTINUE } ///////////////////// public rocket_init(id) {     new rocketID     rocketID = create_entity("info_target")     if(rocketID == 0)         return PLUGIN_CONTINUE     entity_set_string(rocketID,EV_SZ_classname,"RPG Rocket")     entity_set_model(rocketID,"models/rpgrocket.mdl")     entity_get_vector(id,EV_VEC_origin,pOrigin)     entity_set_origin(rocketID,pOrigin)     entity_set_int(rocketID,EV_INT_solid,1)     entity_set_int(rocketID,EV_INT_movetype,6)     OwnerID = entity_set_edict(rocketID,EV_ENT_owner,id)     get_user_origin(id,AimOrigin[id],3)     new pID[2]     pID[0] = id     set_task(0.1,"rocket_fired",0,pID,1)     return PLUGIN_CONTINUE } public rocket_fired(pID[0]) {     if(floatround(pOrigin[0]) > AimOrigin[pID[0]][0])     {         pOrigin[0] = (pOrigin[0] + 0.1)     }     if(floatround(pOrigin[0]) < AimOrigin[pID[0]][0])     {         pOrigin[0] = (pOrigin[0] - 0.1)     }     if(floatround(pOrigin[1]) > AimOrigin[pID[0]][1])     {         pOrigin[1] = (pOrigin[1] + 0.1)     }     if(floatround(pOrigin[1]) < AimOrigin[pID[0]][1])     {         pOrigin[1] = (pOrigin[1] - 0.1)     }     if(floatround(pOrigin[2]) > AimOrigin[pID[0]][2])     {         pOrigin[2] = (pOrigin[2] + 0.1)     }     if(floatround(pOrigin[0]) < AimOrigin[pID[0]][2])     {         pOrigin[2] = (pOrigin[2] - 0.1)     }     set_task(0.2,"rocket_fired",0,pID,1)     return PLUGIN_CONTINUE } public pfn_touch(ptr,ptd) {     OwnerID = entity_get_edict(ptd,EV_ENT_owner)     if(ptr == OwnerID)     {         return PLUGIN_CONTINUE     }     else     {         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)         write_byte(3)         write_coord(AimOrigin[ptr][0])         write_coord(AimOrigin[ptr][1])         write_coord(AimOrigin[ptr][2])         write_short(Fire)         write_byte(20)         write_byte(5)         write_byte(0)         message_end()     }     remove_task(OwnerID)     return PLUGIN_CONTINUE }

Code:
Small compiler 2.1.0            Copyright (c) 1997-2002, ITB CompuPhase

Done.
Press ANY key to continue...
NOW WHERE DO I FIND THAT DAMN ANY KEY !!!!!!
__________________
My Plugins

Got ??
AssKicR is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 04-09-2004 , 23:08   grrrrr
Reply With Quote #7

now I get some Fatal Error message when I use the cmd fire_rocket. Tis a mesage on string '26' I believe Any ideas?
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 04-09-2004 , 23:11  
Reply With Quote #8

exact message would help.....
Freecode is offline
DoubleTap
Veteran Member
Join Date: Mar 2004
Location: Harker Heights, TX
Old 04-10-2004 , 00:15  
Reply With Quote #9

Dude, in all seriousness... why reinvent the wheel. Take the missiles code and make it work right, I can (and have for tests) ported it. THE ONLY issue I have seen so far (other than not being able to use CMath functions) is when the plugin is enabled folks cannot pick up weapons. Lud was the tricky stuff master and got bored/tired when Steam came out and all the new functons caused problems for new admins.

I have contacted him about all his plugins and he WANTS good folks to take on his work. "WE" as an admin community know his stuff works/worked for AMX. Some of you guys who actually know code could easily take the good things out there now and make them better... guys like me porting stuff is not the same as smart guys reworking these things...

Vic/DT

I am fairly sure the Dev's here know I am speaking legit about Luds wishes, if you have any doubts I can copy his AMX messages to me about this very thing and ANY admin that runs Lud's plugins knows I have always chimed in about his stuff and he knows who I am from AMX... There are about a dozen folks in AMXX who could really do those plugins right... Unfortunately for us "ADMINS" most are on the "Dev Team" and rightfully have other priorities...
__________________
DoubleTap is offline
Send a message via ICQ to DoubleTap
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-10-2004 , 09:12  
Reply With Quote #10

i could port any of plugin in under 5min.. including LUDs plugins....

it is just i don't wanna post alot of plugins that ain't mine
__________________
My Plugins

Got ??
AssKicR is offline
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:04.


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