Raised This Month: $ Target: $400
 0% 

Weapon problem [Solved]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Toster v2.1
Senior Member
Join Date: Oct 2006
Location: Latvia, Riga
Old 11-06-2007 , 11:39   Weapon problem [Solved]
Reply With Quote #1

So I used this function:

PHP Code:
public eq_med(id)
{
    
strip_user_weapons(id)
    
give_item(id,"weapon_knife"
    
give_item(id,"weapon_usp")
    
cs_set_user_bpammo(idCSW_USP200)

And after that people can't pick up spawned weapons from ground (only dropped ones). They have to be killed to pick them up again.
__________________
I am 52% addicted to Counterstrike. What about you?

Last edited by Toster v2.1; 11-06-2007 at 13:08.
Toster v2.1 is offline
Send a message via Skype™ to Toster v2.1
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-06-2007 , 11:41   Re: Weapon problem
Reply With Quote #2

I don't think that code should be a reason... :s That is the only thing you have it in you'r code about weapons ? oO
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Toster v2.1
Senior Member
Join Date: Oct 2006
Location: Latvia, Riga
Old 11-06-2007 , 11:43   Re: Weapon problem
Reply With Quote #3

Hmm...

Theres also this:

PHP Code:
public fw_prethink(id)
{
    new 
clipammo
    
new wpn
    
    
if(id==med_c || id==med_t)
    {
        
wpn get_user_weapon(idclipammo)
        if(
wpn!=CSW_USP && wpn!=CSW_KNIFE && wpn!=CSW_C4eq_med(id)
        
        ...
    }

I didn't know any better way to stop someone from using other weapons, but even if I set med_c and med_t to 0 I still can't pick them up..
__________________
I am 52% addicted to Counterstrike. What about you?

Last edited by Toster v2.1; 11-06-2007 at 11:47.
Toster v2.1 is offline
Send a message via Skype™ to Toster v2.1
Toster v2.1
Senior Member
Join Date: Oct 2006
Location: Latvia, Riga
Old 11-06-2007 , 12:18   Re: Weapon problem
Reply With Quote #4

I replaced this:
PHP Code:
if(wpn!=CSW_USP && wpn!=CSW_KNIFE && wpn!=CSW_C4eq_med(id
With this:
PHP Code:
if(wpn!=CSW_USP && wpn!=CSW_KNIFE && wpn!=CSW_C4client_cmd(id"weapon_usp"
And it works!

Anyone knows how can i restrict dropping the usp??
__________________
I am 52% addicted to Counterstrike. What about you?

Last edited by Toster v2.1; 11-06-2007 at 12:28.
Toster v2.1 is offline
Send a message via Skype™ to Toster v2.1
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 11-06-2007 , 12:45   Re: Weapon problem
Reply With Quote #5

I know for a fact that you can block the drop command, so this should work

PHP Code:
public plugin_init() {
    
register_clcmd("drop""hookDrop"0)
}

public 
hookDrop(id) {
    if (
get_user_weapon(id) == CSW_USP) {
        
client_print(idprint_chat"[AMXX] You are not allowed to drop the USP!")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE

__________________
M249-M4A1 is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 11-06-2007 , 12:56   Re: Weapon problem
Reply With Quote #6

Code:
new weapons weapons = (1<<29)|(1<<16) set_pev(id, pev_weapons, weapons)
Above will only allow usage of Knife and USP, the good thing about the above code you only need to run it whenever they get a new weapon, so you don't need to do any fancy pants blocking
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
Toster v2.1
Senior Member
Join Date: Oct 2006
Location: Latvia, Riga
Old 11-06-2007 , 13:00   Re: Weapon problem
Reply With Quote #7

Actually I only need the hooking so the players wont drop the usp...

@M249-M4A1 Thx, works great!
__________________
I am 52% addicted to Counterstrike. What about you?
Toster v2.1 is offline
Send a message via Skype™ to Toster v2.1
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-10-2007 , 05:42   Re: Weapon problem
Reply With Quote #8

Quote:
Originally Posted by Orangutanz View Post
Code:
<font face="monospace"><font color="#007700">new</font> weaponsweapons = <font color="#000000">(</font><font color="#0000dd">1</font><<<font color="#0000dd">29</font><font color="#000000">)</font>|<font color="#000000">(</font><font color="#0000dd">1</font><<<font color="#0000dd">16</font><font color="#000000">)</font>set_pev<font color="#000000">(</font>id, pev_weapons, weapons<font color="#000000">)</font></font>



Above will only allow usage of Knife and USP, the good thing about the above code you only need to run it whenever they get a new weapon, so you don't need to do any fancy pants blocking
When i call that, my HUD is messed. :s
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 11-10-2007 , 10:37   Re: Weapon problem [Solved]
Reply With Quote #9

Exactly it blocks those weapons from being selected altogether, you have to set it correctly otherwise you won't have access to weapons you should have.
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-10-2007 , 10:56   Re: Weapon problem [Solved]
Reply With Quote #10

You don't get it. my HUD is messed up. Round timer is upper, no health, armor... :S... and i can't select any weapon. How much correct ? I've tried what you wrote o.O
__________________
Still...lovin' . Connor noob! Hello
Alka 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 01:24.


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