Raised This Month: $ Target: $400
 0% 

[REQ] Block Weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-14-2015 , 13:30   [REQ] Block Weapons
Reply With Quote #1

So I want to add a block weapons to my Days menu:

I do a Royal (Without Weapons):

T's get only knife

Now imagine this:

One of the terrorists want to pickup a weapon of the floor, but he wont with this plugin..

Like I want it to block weapons but I want it inside a day..

Last edited by Gh05t04; 08-14-2015 at 13:44.
Gh05t04 is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 08-14-2015 , 14:19   Re: [REQ] Block Weapons
Reply With Quote #2

I too have a doubt can we just block for some time x seconds? Or for ,2 rounds?
tousif is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-14-2015 , 14:46   Re: [REQ] Block Weapons
Reply With Quote #3

You can set a bool when day start and check it in touch. If bool is true supercede, else do nothing.
__________________
HamletEagle is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-14-2015 , 16:56   Re: [REQ] Block Weapons
Reply With Quote #4

I've tryed it, but when the round starts, no one can pickup weapons!
Gh05t04 is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 08-14-2015 , 20:22   Re: [REQ] Block Weapons
Reply With Quote #5

Show us what did you tried.
Freezo Begin is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-14-2015 , 20:53   Re: [REQ] Block Weapons
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <engine>
#include <cstrike>
 
new bool:g_BlockPickup[33];
 
public 
plugin_init()
{
        
register_plugin("Block Pickup""1.0""AMXX Community");
 
        
register_logevent"LogEvent_RoundEnd",     2"1=Round_End"     );
 
        
register_touch("weaponbox""player""BlockPickup");
        
register_touch("armoury_entity""player""BlockPickup");
        
register_touch("weapon_shield""player""BlockPickup");
}

public 
LogEvent_RoundEnd()
{
    
SayBlock()
}
 
public 
client_putinserver(Client)
        
g_BlockPickup[Client] = false;
 
public 
SayBlock(Client)
        if (
cs_get_user_team(Client) == CS_TEAM_T)
                
g_BlockPickup[Client] = !g_BlockPickup[Client];
 
public 
BlockPickup(EntityClient)
        return (
g_BlockPickup[Client] && cs_get_user_team(Client) == CS_TEAM_T) ? PLUGIN_HANDLED PLUGIN_CONTINUE
Gh05t04 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 08-15-2015 , 04:48   Re: [REQ] Block Weapons
Reply With Quote #7

LogEvent_RoundEnd() doesn't pass players index's. You need to reset the bool on spawn or use a for loop and cycle thru players index's in round end event
__________________
Blizzard_87 is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-15-2015 , 10:26   Re: [REQ] Block Weapons
Reply With Quote #8

Can someone help me with that?

EDIT:

This?

PHP Code:
#include <amxmodx> 
#include <engine> 
#include <cstrike> 
  
new bool:g_BlockPickup[33]; 
  
public 
plugin_init() 

        
register_plugin("Block Pickup""1.0""AMXX Community"); 
  
        
register_logevent"LogEvent_RoundEnd"2"1=Round_End");
        
register_logevent"LogEvent_RoundStart"2"1=Round_Start" );
  
        
register_touch("weaponbox""player""BlockPickup"); 
        
register_touch("armoury_entity""player""BlockPickup"); 
        
register_touch("weapon_shield""player""BlockPickup"); 


public 
LogEvent_RoundStart()
{
    
g_BlockPickup[id] = true
}

public 
LogEvent_RoundEnd(Client

    
SayBlock(Client

  
public 
client_putinserver(Client
        
g_BlockPickup[Client] = false
  
public 
SayBlock(Client
        if (
cs_get_user_team(Client) == CS_TEAM_T
                
g_BlockPickup[Client] = !g_BlockPickup[Client]; 
  
public 
BlockPickup(EntityClient
        return (
g_BlockPickup[Client] && cs_get_user_team(Client) == CS_TEAM_T) ? PLUGIN_HANDLED PLUGIN_CONTINUE

Last edited by Gh05t04; 08-15-2015 at 10:30.
Gh05t04 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 08-15-2015 , 19:09   Re: [REQ] Block Weapons
Reply With Quote #9

Quote:
Originally Posted by Blizzard_87 View Post
LogEvent_RoundEnd() doesn't pass players index's. You need to reset the bool on spawn or use a for loop and cycle thru players index's in round end event
Or try this in round end.

arrayset( g_BlockPickup, false, charsmax( g_BlockPickup ) );

On mobile so haven't tested it.
__________________

Last edited by Blizzard_87; 08-15-2015 at 19:15.
Blizzard_87 is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-15-2015 , 21:32   Re: [REQ] Block Weapons
Reply With Quote #10

Didn't compile :s
Gh05t04 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 08:52.


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