|
New Member
Join Date: Jul 2008
Location: The States
|

07-25-2008
, 23:24
Re: Simple No Reload, A
|
#5
|
Quote:
Originally Posted by danielkza
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
}
__________________

|
|