Raised This Month: $40 Target: $400
 10% 

[STOCK] get_current_weapon_speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 05-28-2014 , 04:10   [STOCK] get_current_weapon_speed
Reply With Quote #1

Description
This stock is return the current weapon speed you handle.


The stock
PHP Code:
stock get_current_weapon_speedid )
{
    new 
iSpeed 0;

    switch( 
get_user_weaponid ) )
    {
        case 
CSW_KNIFEiSpeed 250;
        case 
CSW_SCOUTiSpeed 260;
        case 
CSW_USPiSpeed 250;
        case 
CSW_P228iSpeed 250;
        case 
CSW_HEGRENADEiSpeed 250;
        case 
CSW_XM1014iSpeed 240;
        case 
CSW_C4iSpeed 250;
        case 
CSW_AUGiSpeed 240;
        case 
CSW_SMOKEGRENADEiSpeed 250;
        case 
CSW_ELITEiSpeed 250;
        case 
CSW_FIVESEVENiSpeed 250;
        case 
CSW_UMP45iSpeed 250;
        case 
CSW_SG550iSpeed 210;
        case 
CSW_GALILiSpeed 240;
        case 
CSW_FAMASiSpeed 240;
        case 
CSW_GLOCK18iSpeed 250;
        case 
CSW_AWPiSpeed 210;
        case 
CSW_MP5NAVYiSpeed 250;
        case 
CSW_M249iSpeed 220;
        case 
CSW_M3iSpeed 230;
        case 
CSW_M4A1iSpeed 230;
        case 
CSW_TMPiSpeed 250;
        case 
CSW_G3SG1iSpeed 210;
        case 
CSW_FLASHBANGiSpeed 250;
        case 
CSW_DEAGLEiSpeed 250;
        case 
CSW_SG552iSpeed 235;
        case 
CSW_AK47iSpeed 221;
        case 
CSW_P90iSpeed 245
    
}
    return 
iSpeed;

Example:

PHP Code:
#include <amxmodx>


public plugin_init( )
{
    
register_clcmd"say /weapon_speed""HookWS" );
}

public 
HookWSid )
{
    
client_printidprint_chat" Weapon from your hand have %d speed."get_current_weapon_speedid ) );
}

stock get_current_weapon_speedid )
{
    new 
iSpeed 0;

    switch( 
get_user_weaponid ) )
    {
        case 
CSW_KNIFEiSpeed 250;
        case 
CSW_SCOUTiSpeed 260;
        case 
CSW_USPiSpeed 250;
        case 
CSW_P228iSpeed 250;
        case 
CSW_HEGRENADEiSpeed 250;
        case 
CSW_XM1014iSpeed 240;
        case 
CSW_C4iSpeed 250;
        case 
CSW_AUGiSpeed 240;
        case 
CSW_SMOKEGRENADEiSpeed 250;
        case 
CSW_ELITEiSpeed 250;
        case 
CSW_FIVESEVENiSpeed 250;
        case 
CSW_UMP45iSpeed 250;
        case 
CSW_SG550iSpeed 210;
        case 
CSW_GALILiSpeed 240;
        case 
CSW_FAMASiSpeed 240;
        case 
CSW_GLOCK18iSpeed 250;
        case 
CSW_AWPiSpeed 210;
        case 
CSW_MP5NAVYiSpeed 250;
        case 
CSW_M249iSpeed 220;
        case 
CSW_M3iSpeed 230;
        case 
CSW_M4A1iSpeed 230;
        case 
CSW_TMPiSpeed 250;
        case 
CSW_G3SG1iSpeed 210;
        case 
CSW_FLASHBANGiSpeed 250;
        case 
CSW_DEAGLEiSpeed 250;
        case 
CSW_SG552iSpeed 235;
        case 
CSW_AK47iSpeed 221;
        case 
CSW_P90iSpeed 245
    
}
    return 
iSpeed;

swapped is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-28-2014 , 05:20   Re: [STOCK] get_current_weapon_speed
Reply With Quote #2

Or you can just use Ham_CS_Item_GetMaxSpeed.
__________________
Arkshine is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-30-2014 , 10:10   Re: [STOCK] get_current_weapon_speed
Reply With Quote #3

Why you made a stock when you could just make a list and post it here ?
HamletEagle is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-30-2014 , 10:52   Re: [STOCK] get_current_weapon_speed
Reply With Quote #4

It's already here anyway : https://wiki.alliedmods.net/CS_Weapons_Information
__________________
Arkshine is offline
DeagLe.Studio
Veteran Member
Join Date: Jun 2012
Location: Home, sweet home!
Old 05-30-2014 , 15:56   Re: [STOCK] get_current_weapon_speed
Reply With Quote #5

Well, he took it from Exolent's HnS plugin I guess, I believe I saw it on it
DeagLe.Studio is offline
Send a message via MSN to DeagLe.Studio Send a message via Yahoo to DeagLe.Studio Send a message via Skype™ to DeagLe.Studio
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-30-2014 , 16:47   Re: [STOCK] get_current_weapon_speed
Reply With Quote #6

Quote:
swapped
BANNED
nice tutorial

BANNED :-D
__________________

Last edited by Bos93; 05-30-2014 at 16:47.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
[email protected]
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 05-30-2014 , 20:09   Re: [STOCK] get_current_weapon_speed
Reply With Quote #7

get_user_weapon not always return correct weapon
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Old 05-31-2014, 04:42
Captain.Diez
This message has been deleted by Captain.Diez.
Reply


Thread Tools
Display Modes

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 20:06.


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