Raised This Month: $ Target: $400
 0% 

Simple No Reload, A


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[phear]crippler
New Member
Join Date: Jul 2008
Location: The States
Old 07-25-2008 , 21:50   Simple No Reload, A
Reply With Quote #1

Hey fellas,

I am learning the logic of programming in my CIS110 class (taking finals in a week) and I run a few servers for Counter-Strike 1.6. One is a zombie mod server which is often criticized for players having to reload their weapons.

Could someone perhaps give me some guide lines to what will need to know to create this simple no reloading plugin. I have the essentials (amx studio, knowing how to properly code)

Hopefully this is one of the better newbie posts and will get a little attention for a new confused modder. A good example of the logic for something like this would be awesome. Thanks.

p.s. The zombie plugin I am using already gives you infinite ammo so that really wouldn't need to be included, just a simple no reload script.
__________________

Last edited by [phear]crippler; 07-25-2008 at 22:56.
[phear]crippler is offline
Send a message via AIM to [phear]crippler
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 07-25-2008 , 21:55   Re: Simple No Reload, A
Reply With Quote #2

You can check out this source maybe:
http://forums.alliedmods.net/showthread.php?p=230183
PvtSmithFSSF is offline
[phear]crippler
New Member
Join Date: Jul 2008
Location: The States
Old 07-25-2008 , 22:47   Re: Simple No Reload, A
Reply With Quote #3

Quote:
Originally Posted by PvtSmithFSSF View Post
You can check out this source maybe:
http://forums.alliedmods.net/showthread.php?p=230183
Yeah, I have actually been trying to use that for a guide line... My only problem is it consist of giving specific people unlimited ammo and not everyone who is playing. I am getting closer for sure by understanding how that one is working but I am still a bit confused on what this plugin is going to need to consist of...

EDIT:
Think I have something here:
Code:
stock maxclip(weapon) 
{
    new ca = 0
    switch (weapon) 
    {
        case CSW_P228 : ca = 13
        case CSW_SCOUT : ca = 10
        case CSW_HEGRENADE : ca = 0
        case CSW_XM1014 : ca = 7
        case CSW_C4 : ca = 0
        case CSW_MAC10 : ca = 30
        case CSW_AUG : ca = 30
        case CSW_SMOKEGRENADE : ca = 0
        case CSW_ELITE : ca = 30
        case CSW_FIVESEVEN : ca = 20
        case CSW_UMP45 : ca = 25
        case CSW_SG550 : ca = 30
        case CSW_GALI : ca = 35
        case CSW_FAMAS : ca = 25
        case CSW_USP : ca = 12
        case CSW_GLOCK18 : ca = 20
        case CSW_AWP : ca = 10
        case CSW_MP5NAVY : ca = 30
        case CSW_M249 : ca = 100
        case CSW_M3 : ca = 8
        case CSW_M4A1 : ca = 30
        case CSW_TMP : ca = 30
        case CSW_G3SG1 : ca = 20
        case CSW_FLASHBANG : ca = 0;
        case CSW_DEAGLE    : ca = 7
        case CSW_SG552 : ca = 30
        case CSW_AK47 : ca = 30
        case CSW_P90 : ca = 50
    }
    return ca;
}
__________________

Last edited by [phear]crippler; 07-25-2008 at 23:03.
[phear]crippler is offline
Send a message via AIM to [phear]crippler
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 07-25-2008 , 22:51   Re: Simple No Reload, A
Reply With Quote #4

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.
danielkza is offline
[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
[phear]crippler
New Member
Join Date: Jul 2008
Location: The States
Old 07-25-2008 , 23:54   Re: Simple No Reload, A
Reply With Quote #6

Bleh, discard this whloe thread, I have found my problem.
__________________
[phear]crippler is offline
Send a message via AIM to [phear]crippler
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 05:37.


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