Raised This Month: $ Target: $400
 0% 

Simple No Reload, A


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
[phear]crippler
New Member
Join Date: Jul 2008
Location: The States
Old 07-25-2008 , 23:24   Re: Simple No Reload, A
Reply With Quote #5

Quote:
Originally Posted by danielkza View Post
The common practice to do things to specific players is keeping an boolean array indicating if each person has the action enabled. You can set these values on console commands,or reading the player admin level on startup,or whatever means you want.
Right, but the thing is, I have everything set for everyone to have unlimited ammo. But what could I do to the source code to insure the player doesn't have to reload?

Code:
stock get_weapon_maxclip(weapon) 
{
    static ammo
    switch(weapon)
    {
        case CSW_P228:              ammo = 13
        case CSW_GALI:              ammo = 35
        case CSW_USP:              ammo = 12
        case CSW_M249:              ammo = 100
        case CSW_M3:              ammo = 8
        case CSW_P90:              ammo = 50
        case CSW_SCOUT, CSW_AWP:      ammo = 10
        case CSW_XM1014, CSW_DEAGLE:     ammo = 7
        case CSW_UMP45, CSW_FAMAS:     ammo = 25
        case CSW_FIVESEVEN, CSW_GLOCK18, 
        CSW_G3SG1:             ammo = 20
        case CSW_KNIFE, CSW_FLASHBANG, 
        CSW_SMOKEGRENADE, CSW_HEGRENADE, 
        CSW_C4:                 ammo = 0
        case CSW_SG552, CSW_AK47,
        CSW_MP5NAVY, CSW_M4A1, 
        CSW_MAC10, CSW_SG550, 
        CSW_AUG, CSW_ELITE, CSW_TMP:     ammo = 30
        default:             ammo = 0
    }
    return ammo
}

stock get_user_bpammo(index, weapon)
{
    static offset
    switch(weapon)
    {
        case CSW_AWP:                offset = OFFSET_AMMO_AWP
        case CSW_SCOUT, CSW_AK47, CSW_G3SG1: offset = OFFSET_AMMO_SCOUT
        case CSW_M249:               offset = OFFSET_AMMO_M249
        case CSW_FAMAS, CSW_M4A1, CSW_AUG, 
        CSW_SG550, CSW_GALI, CSW_SG552:         offset = OFFSET_AMMO_FAMAS
        case CSW_M3, CSW_XM1014:         offset = OFFSET_AMMO_M3
        case CSW_USP, CSW_UMP45, CSW_MAC10:  offset = OFFSET_AMMO_USP
        case CSW_FIVESEVEN, CSW_P90:         offset = OFFSET_AMMO_FIVESEVEN
        case CSW_DEAGLE:             offset = OFFSET_AMMO_DEAGLE
        case CSW_P228:                 offset = OFFSET_AMMO_P228
        case CSW_GLOCK18, CSW_TMP, CSW_ELITE, 
        CSW_MP5NAVY:                 offset = OFFSET_AMMO_GLOCK18
        default:                 offset = 0
    }
    return offset ? get_pdata_int(index, offset) : 0
}

stock set_user_bpammo(index, weapon, amount)
{
    static offset
    switch(weapon)
    {
        case CSW_AWP:                offset = OFFSET_AMMO_AWP
        case CSW_SCOUT, CSW_AK47, CSW_G3SG1: offset = OFFSET_AMMO_SCOUT
        case CSW_M249:               offset = OFFSET_AMMO_M249
        case CSW_FAMAS, CSW_M4A1, CSW_AUG, 
        CSW_SG550, CSW_GALI, CSW_SG552:         offset = OFFSET_AMMO_FAMAS
        case CSW_M3, CSW_XM1014:         offset = OFFSET_AMMO_M3
        case CSW_USP, CSW_UMP45, CSW_MAC10:  offset = OFFSET_AMMO_USP
        case CSW_FIVESEVEN, CSW_P90:         offset = OFFSET_AMMO_FIVESEVEN
        case CSW_DEAGLE:             offset = OFFSET_AMMO_DEAGLE
        case CSW_P228:                 offset = OFFSET_AMMO_P228
        case CSW_GLOCK18, CSW_TMP, CSW_ELITE, 
        CSW_MP5NAVY:                 offset = OFFSET_AMMO_GLOCK18
        default:                 offset = 0
    }
    
    if(offset) set_pdata_int(index, offset, amount)
    
    return 1
}
__________________
[phear]crippler is offline
Send a message via AIM to [phear]crippler
 



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 05:37.


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