![]() |
Re: cs weapons modification
I believe you can look at the war3mod made for amx and see how Orcs do more damage with nades..
|
Re: cs weapons modification
Yes that can be done. Anyway, I don't think grenades would have a detonation event. They would probably spawn a sprite, make a sound, and be removed.It's the damage you need to look at.
|
Re: cs weapons modification
Quote:
|
Re: cs weapons modification
I hope this is not too late but I think you can find out when a HE grenade detonates by hooking pfnRemoveEntity and checking if edict_t*->classname is the grenade.
Its been a while since I played with CS so I'm not sure of the name. What you could do is hook the pfnRemoveEntity function and log the entities passed to it to either the server log or your local console with CLIENT_PRINT. Note, coded in the quick reply box - may not be accurate Code:
void RemoveEntity( edict_t* pEntity ) { |
Re: cs weapons modification
interesting ... thanks Lazy. Will check this out.
Meanwhile, I had a look at the AMX-X framework. Nice thing. A lot can be done using their PAWN script language, and quite easily. |
Re: cs weapons modification
Ok folks,
I think I almost made it. The HE grenades' strength in CS can now be adjusted at will. Here's what I did: - Intercepted "Damage" message to player entity - checked pPlayer->v.dmg_inflictor for grenade entity - if yes, then adjust pPlayer->v.health accordingly to do more damage - send message to all other players about changed health Don't do the last two steps if adjusting the health would result in pPlayer->v.health <= 0. And that's the problem. If, say, player health is 49, and health would be reduced by 50, I can't do it. I would have to let the player die. How can one make a player die ? Is there something like pEntity->kill ? |
Re: cs weapons modification
As far as I know it's impossible to inflict real damage to a player outside the mod unless you have the source.
Although, a while ago I posted an extremely cheap hack to cause real damage to entities. It involved creating a trigger_hurt entity with the right settings and forcing the target player to touch it. The one I posted on here had a few careless bugs that crept in due to lack of sleep but this one should work. Code:
// Causes pain to someone by using a trigger_hurt to apply damage Good luck on your plugin. |
Re: cs weapons modification
well if you look in the war3 mod it also simulates death of a player..
http://amxmod.net/showplugin.php?id=130081 search for do_damage |
Re: cs weapons modification
Man, you guys are great, thanks for all the suggestions ! :)
@Lazy: That's exactly the point. I could kill a player by just calling MDLL_ClientKill, but then this looks like suicide for the player and the attacker doesn't get any credit. Just one line, works nicely, except for the credit situation. @sPlOrYgOn: I checked out that code. It's basically setting the health of the player accordingly, and setting a flag if player is dead (i. e. health <= 0). But in this case, just setting health = 0 and killed = 1 is not sufficient. I need to make the player die "naturally" in terms of the engine if I detect that healt <= 0. There's a method TakeDamage for an entity, however I would need to make a CBasePlayer* or somethink like that out of the edict_t* I've got in order to call this. There must be a way to do this, I'll keep searching ...8) |
Re: cs weapons modification
You can get a CBaseEntity pointer from an edict_t pointer by calling CBaseEntity::Instance( edict_t* ).
BUT, don't expect it to work or not crash since almost every mod makes changes to the top of the CBaseEntity class which breaks compatibility by changing the positions of variables inside the class. One exception is natural selection which does allow you to call CBaseEntity::TakeDamage. I'll think for a bit and see if theres any way to cause damage to a player but as far as I know no other entities can have variable damage amounts. |
All times are GMT +2. The time now is 10:35. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.