AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solid entity follows player, and when touches him, does dmg (https://forums.alliedmods.net/showthread.php?t=12844)

LynX 04-26-2005 13:46

Solid entity follows player, and when touches him, does dmg
 
Okay, I need a help. I'm trying to make a plugin with all sorts of pickups, etc.

So, idea for this thing is to create entity which has his own model, his speed and is solid, and when entity is released by owner player, it catches closest enemy and when touches him does the damage.
So, mine questions are:
How to make that entity stays close to players origin untill player releases binded button for creationg of entity? SO, basic idea is while your holding pressed button, it isn't released, and when you release the button it will launch?
How to give that entity its own speed?
How to make it follows closest enemy?
How to make it that when it touches something it explodes and if its player damages him?

Thanks alot .

Cronck 04-26-2005 15:09

If im not wrong, this would be crappy if you aren't going to use waypoints for the etinity like bots do...

LynX 04-26-2005 15:22

No, it won't be crappy because for mod I'm making for it maps have ALOT of space.
Or, if it would be easier for you guys - just show me how can I make it that it goes on spot I looked after I released entity ( it should not follow crosshair position ).

Ced 04-26-2005 17:17

give it speed by setting its velocity. Look at the beyonder superhero for a reference for moving and following a player, but be sure to give credit. And for the two entities touching, use
Code:
pfn_touch( ptr, ptd )

LynX 04-27-2005 02:05

Well, I'm gonna look. BUt how to make when it touches player it kills him?
And I think setting speed of entity can be done with entity_get_int ?

LynX 04-27-2005 02:52

Okay, I got this:

Code:
#include <amxmodx> #include <engine> #include <fakemeta> public plugin_init() {     register_plugin("Entity spawn","0.1","EncorE_SX")     register_clcmd("spawn_custom","create")     return PLUGIN_CONTINUE } new iEntity[33] public create(id) {     new origin[3]     get_user_origin(id, origin[3],0)     new Origin = origin[2] + 10.0     iEntity[id] = create_entity("info_target")     entity_set_string(iEntity[id], EV_SZ_classname, "TestEntity")     entity_set_model(iEntity[id], "sprites/custom.spr")     entity_set_origin(iEntity[id], genericOrigin )     return PLUGIN_HANDLED } public plugin_precache() {     precache_model("sprites/custom.spr")     return PLUGIN_CONTINUE }

Now, it gives tons of errors... Can you guys fix it for me?
AND, how do I make it goes directly on position I'm looking at ( where crosshair is ). Or, how to make it go on position where I looked at while launching was in progress... HELP...


All times are GMT -4. The time now is 16:45.

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