AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   creating an "trigger_hurt" entity (https://forums.alliedmods.net/showthread.php?t=28119)

wouter 05-07-2006 14:50

creating an "trigger_hurt" entity
 
i just dont get it how to create an entity :oops:
can someone explaine me (on an example if you like, i need a trigger_hurt of 1 dmmg evry second)

thx

FatalisDK 05-07-2006 15:09

Code:
new Ent = create_entity("trigger_hurt") DispatchKeyValue(Ent, "dmg", "1") DispatchSpawn(Ent) entity_set_size(Ent, Float:{-32.0, -32.0, -32.0}, Float:{32.0, 32.0, 32.0})

I think that's how you would do it in engine.

wouter 05-07-2006 15:52

thx, do you allso know how you can teleport it to somewere?

Code:
public hurt (id) {         new Ent = create_entity("trigger_hurt")     DispatchKeyValue(Ent, "dmg", "1")     DispatchSpawn(Ent)     set_size(Ent, Float:{-32.0, -32.0, -32.0}, Float:{32.0, 32.0, 32.0})           new Float:entorigin[3]     entity_get_vector (id, EV_VEC_origin, entorigin) // line 117     entity_set_vector (Ent, EV_VEC_origin, entorigin)       }

dont work (i used id not 0 :? )
Code:

(plugin "cstrike\addons\amxmodx\plugins\dig_you_in.amxx")
L 05/07/2006 - 21:49:53: [AMXX]    [0] dig_you_in.sma::hurt (line 117)
L 05/07/2006 - 21:50:03: [AMXX] [ENGINE] Invalid player 0 (not in-game)
L 05/07/2006 - 21:50:03: [AMXX] Displaying call trace


Orangutanz 05-07-2006 16:08

Force your player to touch the trigger_hurt.

In engine you have force_touch(id, ent)

karlos 05-07-2006 16:48

entity_set_vector (Ent, EV_VEC_origin, entorigin)
will not change the origin. you need:
entity_set_origin (Ent, entorigin)

even if you used id, id is just place holder for a number
seems you called the function for id = 0

wouter 05-08-2006 09:53

thx try them both if i get home

Xanimos 05-08-2006 12:02

your problem is that in hurt(id) there is no id variable that will be sent to it. You need to get the id some other way.

VEN 05-08-2006 13:07

wouter: did you looked into engine_stocks.inc
Code:
stock fakedamage(idvictim,szClassname[],Float:takedmgdamage,damagetype)
Seems like that stock is similar to what you are trying to do.


All times are GMT -4. The time now is 05:00.

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