Raised This Month: $ Target: $400
 0% 

creating an "trigger_hurt" entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wouter
Senior Member
Join Date: Feb 2005
Location: Belgium
Old 05-07-2006 , 14:50   creating an "trigger_hurt" entity
Reply With Quote #1

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

thx
wouter is offline
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 05-07-2006 , 15:09  
Reply With Quote #2

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.
__________________
FatalisDK is offline
wouter
Senior Member
Join Date: Feb 2005
Location: Belgium
Old 05-07-2006 , 15:52  
Reply With Quote #3

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
wouter is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 05-07-2006 , 16:08  
Reply With Quote #4

Force your player to touch the trigger_hurt.

In engine you have force_touch(id, ent)
Orangutanz is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 05-07-2006 , 16:48  
Reply With Quote #5

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
__________________
alias White Panther
karlos is offline
wouter
Senior Member
Join Date: Feb 2005
Location: Belgium
Old 05-08-2006 , 09:53  
Reply With Quote #6

thx try them both if i get home
wouter is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 05-08-2006 , 12:02  
Reply With Quote #7

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.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
VEN
Veteran Member
Join Date: Jan 2005
Old 05-08-2006 , 13:07  
Reply With Quote #8

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.
VEN is offline
Reply



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 05:00.


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