AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie:Reloaded (https://forums.alliedmods.net/forumdisplay.php?f=132)
-   -   [request] Infection Bomb (https://forums.alliedmods.net/showthread.php?t=173719)

nicekill 12-09-2011 12:18

[request] Infection Bomb
 
Could someone make an "Infection Bomb" like in ZP4.3 but for Zombie Reloaded? Players can buy it for $10,000

KyleS 12-09-2011 14:23

Re: [request] Infection Bomb
 
If you could be more specific about what it is... I'm sure that would help.

nicekill 12-09-2011 15:03

Re: [request] Infection Bomb
 
it's a special grenade that zombies can buy. when it explodes, it infects all nearby humans.

Paparazziv2 12-09-2011 20:39

Re: [request] Infection Bomb
 
with a ratio.. is same than grenade effects plugin Ç(Freezer grenade) but this grenade infect.

nicekill 12-12-2011 19:19

Re: [request] Infection Bomb
 
I'm going to try and make this myself using what I can learn from lasermine and grenade-effects.

nicekill 12-12-2011 22:28

Re: [request] Infection Bomb
 
2 Attachment(s)
Can somone help me with this? Look at my attached script. I can't get it to compile. :down:

Basically I need to override the hook callback function RestrictCanUse from zr/weapons/restrict.inc and replace it with my own zr_nade_RestrictCanUse.

Once I've done that, the rest will be easy.

rhelgeby 12-12-2011 22:54

Re: [request] Infection Bomb
 
To do that you'll need to modify ZR itself. You can't override stuff in ZR from other plugins.

The tricky part here is to allow zombies to use grenades without ZR blocking it. What you want to do conflicts with how ZR works. I actually don't know how to do that without modifying ZR itself, but again, then you'll need to do an unofficial special release of ZR with this feature.

ZR is using SDK Hooks to block zombies from picking up weapons. If several plugins try to hook this, I guess the most restrictive result (blocking) will be the final result, even if other plugins say it's allowed.

nicekill 12-12-2011 23:08

Re: [request] Infection Bomb
 
2 Attachment(s)
Quote:

Originally Posted by rhelgeby (Post 1612233)
You can't override stuff in ZR from other plugins.

Well, I don't believe that. I'll wait for more coders to give their opinion.
And when I said "override", I meant "replace" ZR's SDKHooks by doing the following:
Code:

// replace hooks
SDKUnhook(client, SDKHook_WeaponCanUse, RestrictCanUse);  // from ZR plugin
SDKHook(client, SDKHook_WeaponCanUse, zr_nade_RestrictCanUse); // to my plugin

I should also mention that ZR's callback function RestrictCanUse is public. I only need a reference to it.

rhelgeby 12-12-2011 23:48

Re: [request] Infection Bomb
 
Public functions, didn't think about that. So, you are trying to remotely unhook something hooked by ZR? Would be really cool if that's actually possible.

If a function reference is all you need, you can get it by using GetFunctionByName. You'll also need ZR's plugin handle. There might be other ways to find it, but you should be able to get it by iterating through plugins (GetPluginIterator, ReadPlugin, GetPluginInfo) and comparing plugin names until you find it.

Also:
PHP Code:

// let ZR handle this
return RestrictCanUse(clientweapon); 

Now that you have the function reference, you can actually call this function dynamically too by using Call_StartFunction, Call_PushCell and Call_Finish.

If this really works, that's just awesome! Nice hacking!

nicekill 12-13-2011 00:32

Re: [request] Infection Bomb
 
Quote:

Originally Posted by rhelgeby (Post 1612246)
Public functions, didn't think about that. So, you are trying to remotely unhook something hooked by ZR? Would be really cool if that's actually possible.

If a function reference is all you need, you can get it by using GetFunctionByName. You'll also need ZR's plugin handle. There might be other ways to find it, but you should be able to get it by iterating through plugins (GetPluginIterator, ReadPlugin, GetPluginInfo) and comparing plugin names until you find it.

Now that you have the function reference, you can actually call this function dynamically too by using Call_StartFunction, Call_PushCell and Call_Finish.

If this really works, that's just awesome! Nice hacking!

That's Great, Thanks for the info. :) I'll post on here if I get it working.


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

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