AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Simple No Reload, A (https://forums.alliedmods.net/showthread.php?t=74837)

[phear]crippler 07-25-2008 21:50

Simple No Reload, A
 
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.

PvtSmithFSSF 07-25-2008 21:55

Re: Simple No Reload, A
 
You can check out this source maybe:
http://forums.alliedmods.net/showthread.php?p=230183

[phear]crippler 07-25-2008 22:47

Re: Simple No Reload, A
 
Quote:

Originally Posted by PvtSmithFSSF (Post 658806)
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;
}


danielkza 07-25-2008 22:51

Re: Simple No Reload, A
 
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.

[phear]crippler 07-25-2008 23:24

Re: Simple No Reload, A
 
Quote:

Originally Posted by danielkza (Post 658832)
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 07-25-2008 23:54

Re: Simple No Reload, A
 
Bleh, discard this whloe thread, I have found my problem.


All times are GMT -4. The time now is 05:37.

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