 |
|
Veteran Member
|

08-04-2010
, 22:47
Re: Weapon Pickup Block
|
#4
|
Quote:
Originally Posted by DarkGod
I saw you looked into it before (I stalked your profile) so you should know how to just block it. Loop through all players and if player has the bool set true, block, else don't.
Simple as that. I'm just too lazy to check up the actual code.
Edit: You could try this:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
new bool:CanPickup[33] = true
public plugin_init()
{
register_plugin( "Block Weapon Pickup", "1.0", "Wrecked" )
new classname[20] // weapon_smokegrenade (19) + 1
for( new i = CSW_P228; i <= CSW_P90; i++ )
{
if ( get_weaponname( i, classname, charsmax( classname ) ) )
{
RegisterHam( Ham_Item_Deploy, classname, "HamItemDeployPre", 0 )
/* Other forwards that you could've used:
* Ham_AddPlayerItem
* Ham_Item_CanDeploy
* Ham_Touch
*/
}
}
}
public HamItemDeployPre( weapon )
{
new players[32], num, index
get_players(players, num)
for(new i; i < num; i++)
{
index = players[i]
if(!CanPickup[index])
return HAM_SUPERCEDE; // blocks function call
}
return HAM_IGNORED
}
|
Nothing I've tried has worked. It's pissing me off.
PHP Code:
public HamItemDeployPre( weapon )
{
new players[32], num;
get_players(players, num)
for(new i; i < num; i++)
{
if( gLastRequest )
{
return HAM_SUPERCEDE;
}
}
return HAM_IGNORED
}
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
|
|
|
|