Raised This Month: $51 Target: $400
 12% 

[request] Infection Bomb


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nicekill
Junior Member
Join Date: Dec 2011
Old 12-09-2011 , 12:18   [request] Infection Bomb
Reply With Quote #1

Could someone make an "Infection Bomb" like in ZP4.3 but for Zombie Reloaded? Players can buy it for $10,000
__________________
nicekill is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 12-09-2011 , 14:23   Re: [request] Infection Bomb
Reply With Quote #2

If you could be more specific about what it is... I'm sure that would help.
KyleS is offline
nicekill
Junior Member
Join Date: Dec 2011
Old 12-09-2011 , 15:03   Re: [request] Infection Bomb
Reply With Quote #3

it's a special grenade that zombies can buy. when it explodes, it infects all nearby humans.
__________________
nicekill is offline
Paparazziv2
Senior Member
Join Date: Feb 2011
Location: Chile, La Serena
Old 12-09-2011 , 20:39   Re: [request] Infection Bomb
Reply With Quote #4

with a ratio.. is same than grenade effects plugin Ç(Freezer grenade) but this grenade infect.
__________________
Sorry for the bad english please.

Paparazziv2 is offline
Send a message via MSN to Paparazziv2
nicekill
Junior Member
Join Date: Dec 2011
Old 12-12-2011 , 19:19   Re: [request] Infection Bomb
Reply With Quote #5

I'm going to try and make this myself using what I can learn from lasermine and grenade-effects.
__________________
nicekill is offline
nicekill
Junior Member
Join Date: Dec 2011
Old 12-12-2011 , 22:28   Re: [request] Infection Bomb
Reply With Quote #6

Can somone help me with this? Look at my attached script. I can't get it to compile.

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.
Attached Files
File Type: sp Get Plugin or Get Source (zr_infect_nade.sp - 238 views - 5.6 KB)
File Type: txt zr_infect_nade.txt (459 Bytes, 220 views)
__________________

Last edited by nicekill; 12-12-2011 at 22:32.
nicekill is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 12-12-2011 , 22:54   Re: [request] Infection Bomb
Reply With Quote #7

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.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 12-12-2011 at 22:56.
rhelgeby is offline
Send a message via MSN to rhelgeby
nicekill
Junior Member
Join Date: Dec 2011
Old 12-12-2011 , 23:08   Re: [request] Infection Bomb
Reply With Quote #8

Quote:
Originally Posted by rhelgeby View Post
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.
Attached Files
File Type: txt zr_infect_nade.txt (459 Bytes, 256 views)
File Type: sp Get Plugin or Get Source (zr_infect_nade.sp - 210 views - 5.6 KB)
__________________

Last edited by nicekill; 12-12-2011 at 23:19.
nicekill is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 12-12-2011 , 23:48   Re: [request] Infection Bomb
Reply With Quote #9

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!
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 12-12-2011 at 23:50.
rhelgeby is offline
Send a message via MSN to rhelgeby
nicekill
Junior Member
Join Date: Dec 2011
Old 12-13-2011 , 00:32   Re: [request] Infection Bomb
Reply With Quote #10

Quote:
Originally Posted by rhelgeby View Post
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.
__________________
nicekill 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:07.


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