Raised This Month: $ Target: $400
 0% 

[CSGO] Client_GiveWeaponAndAmmo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
maningrey
Member
Join Date: Sep 2014
Location: Farswitch Newton 1
Old 01-24-2015 , 13:02   [CSGO] Client_GiveWeaponAndAmmo
Reply With Quote #1

Hello

I'm finding a bug whilst using "Client_GiveWeaponAndAmmo", nothing fancy pretty simple stuff

PHP Code:
public Action:taser(clientargs

    
    
Client_GiveWeaponAndAmmo(client"weapon_taser"190)
    
    return 
Plugin_Handled

but for some reason it spawns the gun and it sounds like a deagle? Any ideas?

Last edited by maningrey; 01-24-2015 at 13:07. Reason: typo
maningrey is offline
EngHell
Member
Join Date: Jul 2013
Location: Guatemala
Old 01-24-2015 , 13:21   Re: [CSGO] Client_GiveWeaponAndAmmo
Reply With Quote #2

Quote:
Originally Posted by maningrey View Post
Hello

I'm finding a bug whilst using "Client_GiveWeaponAndAmmo", nothing fancy pretty simple stuff

PHP Code:
public Action:taser(clientargs

    
    
Client_GiveWeaponAndAmmo(client"weapon_taser"190)
    
    return 
Plugin_Handled

but for some reason it spawns the gun and it sounds like a deagle? Any ideas?
It's because the taser goes as 2 slot weapo, a meely one, then yo do this:
PHP Code:
public Action:taser(clientargs

    
    
Client_GiveWeaponAndAmmo(client"weapon_taser"290)
    
    return 
Plugin_Handled

EngHell is offline
maningrey
Member
Join Date: Sep 2014
Location: Farswitch Newton 1
Old 01-24-2015 , 13:56   Re: [CSGO] Client_GiveWeaponAndAmmo
Reply With Quote #3

Hey thanks for the reply, it didn't work.

Here is an example

https://www.youtube.com/watch?v=Qk63...ature=youtu.be

I've modified no client side sound files ect...
maningrey is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-24-2015 , 14:14   Re: [CSGO] Client_GiveWeaponAndAmmo
Reply With Quote #4

Its a common bug, i think you need to create the taser, and then equip it to the player, else it gets the deagle properties.
Mitchell is offline
maningrey
Member
Join Date: Sep 2014
Location: Farswitch Newton 1
Old 01-24-2015 , 14:22   Re: [CSGO] Client_GiveWeaponAndAmmo
Reply With Quote #5

PHP Code:
public Action:taser(clientargs)
{
        if(
IsPlayerAlive(client) && IsClientInGame(client))
        {
                
DropPlayerWeaponOnSlot(client,1);
                
GivePlayerItem(client"weapon_taser");
        } 

How can I apply the ammo through? This is why I used "Client_GiveWeaponAndAmmo"
maningrey is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 01-24-2015 , 17:53   Re: [CSGO] Client_GiveWeaponAndAmmo
Reply With Quote #6

from smlib

stock Weapon_SetPrimaryClip(weapon, value);
stock Weapon_SetSecondaryClip(weapon, value);
stock Weapon_SetClips(weapon, primary, secondary);
stock Weapon_SetPrimaryAmmoCount(weapon, value);
stock Weapon_SetSecondaryAmmoCount(weapon, value);
stock Weapon_SetAmmoCounts(weapon, primary, secondary);

https://forums.alliedmods.net/showpo...46&postcount=2

Last edited by 8guawong; 01-24-2015 at 18:04.
8guawong is offline
maningrey
Member
Join Date: Sep 2014
Location: Farswitch Newton 1
Old 01-26-2015 , 17:50   Re: [CSGO] Client_GiveWeaponAndAmmo
Reply With Quote #7

Thanks, I got it working
maningrey is offline
m_bNightstalker
Senior Member
Join Date: Jan 2015
Location: JWD
Old 01-30-2015 , 20:23   Re: [CSGO] Client_GiveWeaponAndAmmo
Reply With Quote #8

Quote:
Originally Posted by Mitchell View Post
Its a common bug, i think you need to create the taser, and then equip it to the player, else it gets the deagle properties.
I can confirm that.
m_bNightstalker 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 11:46.


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