AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   2 features help!!!! (useful for many ppl i think) (https://forums.alliedmods.net/showthread.php?t=20119)

haimmaik 11-01-2005 19:39

2 features help!!!! (useful for many ppl i think)
 
-_O i know thats gonna sound kinda stupid.. but..

1. how can i make a plasma shot?
i want a blue energy ball (plasma shot) to fly out of the shooter and explow when it hits something solid like WALL not player. (i want it to go through the players and kill/cuz damage to them)

2. how can i make a suicide bomb that kills me + everything else in the explotion area (even ppl that hide behind boxes or something)

PLZ HELP ME ITS THE LAST 2 THINGS!!

(after i get this.. my plugin will be fully prepared and ill release it.. its soooooo COOL i played hours with a friend and ITS NOT EVEN FINISHED)

its a Predator mode.
u can pay 16000 money and 10 frags to become a predator
predator is invisable, he got better speed and jump. u cant hear him comming.. his knife does X2 damage (he can only use the knife though)
[should be able to shoot 1 plasma shoot every round]
[should be able to kill himself with a great bomb (killing everything else on the map]

I HAVE MODELS I HAVE SOUNDS I HAVE EVERYTHING! PLZ
THANKS ALOT I LOVE YOU ALL!!

Zenith77 11-01-2005 19:56

Just register the command in plugin_init()

Code:
register_clcmd("say shoot", "myFunc")



You need to create an entity for you plasma ball...

Code:
new ePlasmaBall = create_entity("info_target")

Set a name for it

Code:
entity_set_string(ePlasmaBall, EV_SZ_classname, "PlasmaBall")

Set the origin

Code:
entity_set_vector(ePlasmaBall, EV_VEC_origin, anOrigin)

Set the size

Code:
new Float:maxs[3] = {32.0,32.0,64.0} new Float:mins[3] = {-32.0,-32.0,-64.0} entity_set_size(ePlasmaBall,mins,maxs)

Make it solid

Code:
entity_set_int(ePlasmaBall,EV_INT_solid, SOLID_BBOX)

Set move type

Code:
entity_set_int(ePlasmaBall,EV_INT_movetype,MOVETYPE_TOSS)



Set a frame rate for the sprite

Code:
entity_set_float(ePlasmaBall,EV_FL_framerate,1.0)

Render it to have a sprite as a model

Code:
set_rendering(ePlasmaBall, kRenderFxNoDissipation, 255, 255, 255, kRenderGlow, 10)


Set Model ( Rember to precache )

Code:
entity_set_model(ePlasmaBall, "sprites/myspr.spr")



Make it emit a sound ( rember to precache it )

Code:
emit_sound(ePlasmaBall, CHAN_STATIC, "ambience/alien_hollow.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

and thats it to create the entity....


And for the explosion...


Register touch in plugin_init()

Code:
register_touch("PlasmaBall","*","plasma_interact")

the touch function..


Note: gExplosionModel is the sprite u use for the explosion model...

Code:
public plasma_interact(ePlasmaBall,other) {     if(other == 0) {                         new Float:fOrigin[3]                 new iOrigin[3]                 entity_get_vector(ePlasmaBall, EV_VEC_origin, fOrigin)                 FVecIVec(fOrigin, iOrigin)                 message_begin(MSG_BROADCAST, SVC_TEMPENTITY)         write_byte(3) // TE_EXPLOSION         write_coord(iOrigin[0])         write_coord(iOrigin[1])         write_coord(iOrigin[2]+50)         write_short(gExplosionModel)         write_byte(100)         write_byte(0)         write_byte(0)         message_end()                 RadiusDamage(fOrigin, 30,  120)                 remove_entity(ePlasmaBall)             }     else if(is_user_connected(other)) {         user_kill(other, 0)                 new origin[3]                 get_user_origin(other, origin, 0)                 message_begin(MSG_BROADCAST, SVC_TEMPENTITY)         write_byte(3) // TE_EXPLOSION         write_coord(origin[0])         write_coord(origin[1])         write_coord(origin[2])         write_short(gExplosionModel)         write_byte(100)         write_byte(0)         write_byte(0)         message_end()                     } }

and there ya go :)

And you may not like the explosion sound it makes when it hits a wall, if you dont, just post back and i can fix that for ya :)

haimmaik 11-01-2005 20:23

it looks amazing... O_O
and advanced X_X...
VERY, advanced.

well.. ill try ^^
THANKS DUDE

(and what about the suicide bomb?)

haimmaik 11-01-2005 20:53

Code:
#include <amxmodx>  #include <amxmisc>  #include <fun>  #include <cstrike>  #include <engine>  public plugin_precache()  {     precache_model("sprites/plasma.spr")     precache_model("sprites/suicideexplode.spr")     precache_sound("misc/doh7.wav")     return PLUGIN_CONTINUE  }  public plugin_init()  {     register_plugin("Plasmatest","1.00","Haim")     register_clcmd("shoot", "myFunc")     register_touch("PlasmaBall","*","plasma_interact")  }  public myfunc(id)  {     new origin[3]     get_user_origin(id,origin,1)     new ePlasmaBall = create_entity("info_target")     entity_set_string(ePlasmaBall, EV_SZ_classname, "PlasmaBall")     entity_set_vector(ePlasmaBall, EV_VEC_origin,origin)     new Float:maxs[3] = {32.0,32.0,64.0}     new Float:mins[3] = {-32.0,-32.0,-64.0}     entity_set_size(ePlasmaBall,mins,maxs)     entity_set_int(ePlasmaBall,EV_INT_solid, SOLID_BBOX)     entity_set_int(ePlasmaBall,EV_INT_movetype,MOVETYPE_TOSS)     entity_set_float(ePlasmaBall,EV_FL_framerate,1.0)     set_rendering(ePlasmaBall, kRenderFxNoDissipation, 255, 255, 255, kRenderGlow, 10)     entity_set_model(ePlasmaBall, "plasma")     emit_sound(ePlasmaBall, CHAN_STATIC, "doh7", 1.0, ATTN_NORM, 0, PITCH_NORM)  }  public plasma_interact(ePlasmaBall,other) {     if(other == 0) {         new Float:fOrigin[3]         new iOrigin[3]         entity_get_vector(ePlasmaBall, EV_VEC_origin, fOrigin)         FVecIVec(fOrigin, iOrigin)         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)         write_byte(3) // TE_EXPLOSION         write_coord(iOrigin[0])         write_coord(iOrigin[1])         write_coord(iOrigin[2]+50)         write_short(gExplosionModel)         write_byte(100)         write_byte(0)         write_byte(0)         message_end()         RadiusDamage(fOrigin, 30,  120)         remove_entity(ePlasmaBall)     }     else if(is_user_connected(other)) {         user_kill(other, 0)         new origin[3]         get_user_origin(other, origin, 0)         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)         write_byte(3) // TE_EXPLOSION         write_coord(origin[0])         write_coord(origin[1])         write_coord(origin[2])         write_short(gExplosionModel)         write_byte(100)         write_byte(0)         write_byte(0)         message_end()     }  }

this is what i did...
and i got 2 errors and 1 warning

Code:

<28>warning 213: tag mismatch
<56>error 017: undefinded symbol "gExplosionModel"
<79>error 017: undefinded symbol "gExplosionModel"

and those are the lines:

Code:

<28>entity_set_vector(ePlasmaBall, EV_VEC_origin,origin)
<56>write_short(gExplosionModel)
<79>write_short(gExplosionModel)


Batman/Gorlag 11-01-2005 20:59

Maybe you should define the symbol?

Code:
new gExplosionModel gExplosionModel = precache_model("sprites/suicideexplode.wav")

haimmaik 11-01-2005 21:06

[edit] here.. i managed to fix all the errors and this is the script:

Code:
 #include <amxmodx>  #include <amxmisc>  #include <fun>  #include <cstrike>  #include <engine>  public plugin_precache()  {     precache_model("sprites/plasma.spr")     precache_model("sprites/suicideexplode.spr")     precache_sound("misc/doh7.wav")     return PLUGIN_CONTINUE  }  public plugin_init()  {     register_plugin("Plasmatest","1.00","Haim")     register_clcmd("shoot","myfunc")     register_touch("PlasmaBall","*","plasma_interact")  }  public myfunc(id)  {     new origin[3]     new Float:forigin[3]     forigin[0]=str_to_float(origin[0])     forigin[1]=str_to_float(origin[1])     forigin[2]=str_to_float(origin[2])     get_user_origin(id,origin,1)     new ePlasmaBall = create_entity("info_target")     entity_set_string(ePlasmaBall, EV_SZ_classname, "PlasmaBall")     entity_set_vector(ePlasmaBall, EV_VEC_origin,forigin)     new Float:maxs[3] = {32.0,32.0,64.0}     new Float:mins[3] = {-32.0,-32.0,-64.0}     entity_set_size(ePlasmaBall,mins,maxs)     entity_set_int(ePlasmaBall,EV_INT_solid, SOLID_BBOX)     entity_set_int(ePlasmaBall,EV_INT_movetype,MOVETYPE_TOSS)     entity_set_float(ePlasmaBall,EV_FL_framerate,1.0)     set_rendering(ePlasmaBall, kRenderFxNoDissipation, 255, 255, 255, kRenderGlow, 10)     entity_set_model(ePlasmaBall, "sprites/plasma.spr")     emit_sound(ePlasmaBall, CHAN_STATIC, "misc/doh7.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)  }  public plasma_interact(ePlasmaBall,other) {     new gExplosionModel = precache_model("sprites/suicideexplode.spr")     if(other == 0) {         new Float:fOrigin[3]         new iOrigin[3]         entity_get_vector(ePlasmaBall, EV_VEC_origin, fOrigin)         FVecIVec(fOrigin, iOrigin)         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)         write_byte(3) // TE_EXPLOSION         write_coord(iOrigin[0])         write_coord(iOrigin[1])         write_coord(iOrigin[2]+50)         write_short(gExplosionModel)         write_byte(100)         write_byte(0)         write_byte(0)         message_end()         RadiusDamage(fOrigin, 30,  120)         remove_entity(ePlasmaBall)     }     else if(is_user_connected(other)) {         user_kill(other, 0)         new origin[3]         get_user_origin(other, origin, 0)         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)         write_byte(3) // TE_EXPLOSION         write_coord(origin[0])         write_coord(origin[1])         write_coord(origin[2])         write_short(gExplosionModel)         write_byte(100)         write_byte(0)         write_byte(0)         message_end()     }  }

but it doesnt work in the game... it does runtime error.. please help me to fix it.. make it work.. PLZ :(

Batman/Gorlag 11-01-2005 21:26

Yeah because the origin you are using is not a float.

Code:
new origin[3], Float:fOrigin[3] get_user_origin(id, origin, 1) IVecFVec(origin, fOrigin) //blah, blah..... entity_set_vector(ePlasmaBall, EV_VEC_origin, fOrigin) //blah, blah....

And what is the runtime error?

Zenith77 11-01-2005 22:03

Code:
 emit_sound(ePlasmaBall, CHAN_STATIC, "misc/doh7.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)


please not this makes it repeat the sound every time it finishes....you might want to choose another sound...

haimmaik 11-01-2005 22:04

it says

L 11/02/2005 - 04:15:39: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/02/2005 - 04:15:39: [AMXX] Run time error 10 (plugin "plasma.amxx") - debug not enable

and i fixed the SMA as u said.. but i still get that error.. please see the SMA and help me :\

Hawk552 11-01-2005 22:05

... enable debug maybe?


All times are GMT -4. The time now is 23:50.

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