Raised This Month: $ Target: $400
 0% 

kill command blocked, how to kill player?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 07-09-2004 , 19:53   kill command blocked, how to kill player?
Reply With Quote #1

i am writing a plugin for natural-selection and i want to kill specific players. but when i use user_kill(id,0 or 1) or set_user_health(id,0), the player wont be killed immediatly but with a 3 second delay, the same as if i would type kill in console.
any1 know how i can kill without that delay??
__________________
alias White Panther
karlos is offline
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 07-09-2004 , 20:03  
Reply With Quote #2

i think the only person here to know that whould be Cheesy
__________________
My Plugins

Got ??
AssKicR is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 07-09-2004 , 20:07  
Reply With Quote #3

take_damage
Or...
Create an entity that does damage on them, wait a second, then remove it
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Bad HAL 9000
Senior Member
Join Date: Mar 2004
Location: Minnesota, USA
Old 07-09-2004 , 20:09  
Reply With Quote #4

yar! I know it also. I had the same problem. You need to use takedamage
__________________
Bad HAL 9000 is offline
Send a message via ICQ to Bad HAL 9000 Send a message via AIM to Bad HAL 9000 Send a message via MSN to Bad HAL 9000 Send a message via Yahoo to Bad HAL 9000
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 07-10-2004 , 04:02  
Reply With Quote #5

k thx but how do i use it?
i tried this but not working entity_set_float(id, EV_FL_takedamage, damage) ?
also tried RadiusDamage(Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier) but do not enething neihter
__________________
alias White Panther
karlos is offline
Bad HAL 9000
Senior Member
Join Date: Mar 2004
Location: Minnesota, USA
Old 07-10-2004 , 05:18  
Reply With Quote #6

oh crap :-\ I could have sworn that they would have added the takedamage native from the NS module back in the day.

crap

What the hell bail! Get that in there!
__________________
Bad HAL 9000 is offline
Send a message via ICQ to Bad HAL 9000 Send a message via AIM to Bad HAL 9000 Send a message via MSN to Bad HAL 9000 Send a message via Yahoo to Bad HAL 9000
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 07-10-2004 , 08:26  
Reply With Quote #7

Heh that reminds me, better fix slay for NS.

Heres code from ns2amx, pretty straight forward to convert it for the engine module.

Code:
stock fakedamage(idvictim,szClassname[],Float:takedmgdamage,damagetype) {     new entity = createentity("trigger_hurt")     if (entity)     {         set_keyvalue(entity,"classname","trigger_hurt")         new szDamage[16]         // Takedamages only do half damage per attack (damage is damage per second, and it's triggered in 0.5 second intervals).         // Compensate for that.         format(szDamage,15,"%f",takedmgdamage * 2)         set_keyvalue(entity,"dmg",szDamage)         format(szDamage,15,"%i",damagetype)         set_keyvalue(entity,"damagetype",szDamage)         set_keyvalue(entity,"origin","8192 8192 8192")         mdll_spawn(entity)         set_pev(entity,pev_classname,make_string(szClassname))         mdll_touch(idvictim,entity)         remove_entity(entity)         return 1     }     return 0 }
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 07-10-2004 , 09:31  
Reply With Quote #8

for me its not straight forward to convert it for the engine module, i replaced (i hope its correct)
createentity() with create_entity()
set_keyvalue() with DispatchKeyValue()
mdll_touch() with fake_touch()

but i dont know what to do with
mdll_spawn(entity)
and
set_pev(entity,pev_classname,make_string(szCl assname))
(maybe entity_set_string() )
__________________
alias White Panther
karlos is offline
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 07-10-2004 , 10:43  
Reply With Quote #9

What you have done is correct.
mdll_spawn is just DispatchSpawn()
yes entity_set_string() is what you should use.
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 07-10-2004 , 12:26  
Reply With Quote #10

ok i've done this:
Code:
#include <ns2amxdefines>  // cause of pev_classname stock fakedamage(idvictim,szClassname[],Float:takedmgdamage,damagetype) {     new entity = create_entity("trigger_hurt")     if (entity)     {         DispatchKeyValue(entity,"classname","trigger_hurt")         new szDamage[16]         // Takedamages only do half damage per attack (damage is damage per second, and it's triggered in 0.5 second intervals).         // Compensate for that.         format(szDamage,15,"%f",takedmgdamage * 2)         DispatchKeyValue(entity,"dmg",szDamage)         format(szDamage,15,"%i",damagetype)         DispatchKeyValue(entity,"damagetype",szDamage)         DispatchKeyValue(entity,"origin","8192 8192 8192")         DispatchSpawn(entity)         entity_set_string(entity,pev_classname,szClassname) //old was entity_set_string(entity,pev_classname,make_string(szClassname))         fake_touch(idvictim,entity)         remove_entity(entity)         return 1     }     return 0 }
and i call this with
Code:
fakedamage(id,"classname",1000.0,0)
and it's still not working, also i have another prob , when i use set_user_maxspeed(id,value) nothing happens, tried to set sv_maxspeed to 1000 too
__________________
alias White Panther
karlos 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 14:57.


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