View Single Post
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 12-13-2011 , 09:44   Re: [request] Infection Bomb
Reply With Quote #13

It crashes, there are a few changes required in zr_nade_RestrictCanUse:

PHP Code:
    // If the player is a zombie
    
if (ZR_IsClientZombie(client)){
        return 
Plugin_Continue;      // you need to return an action, not return nothing.
    

PHP Code:
    new Action:result;
    
Call_Finish(result);            // get the result from ZR's function and return it.
    
return result
I've also removed the hook/unhook functions in zr_nade_RestrictCanUse. One of those caused the crashes - and they aren't really needed.

Once I got it running, it spawned a grenade, but doesn't seem to actually unhook ZR's hook. Weapons are still blocked for zombies. I added a few print statements to see if your plugins hook worked. It did and returned Plugin_Continue (allow pickup) as expected. But ZR's hook was also called (after your plugin), which blocked pickup.

The SDKUnhook function doesn't tell if it actually unhooked something. This would be nice to know. A debug build of SDK Hooks should print this to the console though.
__________________
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-13-2011 at 09:46.
rhelgeby is offline
Send a message via MSN to rhelgeby