Raised This Month: $51 Target: $400
 12% 

[l4d2] Smart Item Selector (v1.2) [5-Mar-2019]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
PatriotGames
AlliedModders Donor
Join Date: Feb 2012
Location: root@irs:/# rm -rf /
Plugin ID:
6447
Plugin Version:
1.2
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Selectively gives items to survivors when they spawn and inlcudes VIP/admin options.
    Old 02-24-2019 , 19:47   [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
    Reply With Quote #1

    Introduction
    Smart Item Selector (sIs) is based on [L4D & L4D2] Round Start Items Giver by kwski43, but takes "item giving" to another level.
    sIs intelligently gives selected items to survivors each time they spawn and includes an option to give different items to VIP/admins.
    This is my first public plugin so constructive feedback is welcome.


    sIs Goals
    Simplify: by eliminating the need for numerous timers there are fewer cvars to set and hopefully, increased reliability.
    Add intelligence: only give items if they are needed or according to a prioritization system. No brute-force item giving and no excess item spawns.
    Add VIP/admin options: offer server operators the option to give different items to VIP/admins based on one or more flags.
    Add flexibility: give items anytime a player spawns (first spawn, bot takeover, rescue closet, re-spawn, joining an in-progress map, etc.) not just at round start.


    The Prioritization System
    sIs uses a 3-tier prioritization system comprised of base, random, and VIP item selections.
    A base item selection is overridden by a random item selection and both of those are overridden by a VIP item selection.
    However, an override will only occur for the same item type (i.e. a VIP primary weapon selection only overrides the other primary weapon selections).

    1. Example: if you configure a base primary weapon and a random primary weapon and a vip primary weapon, survivors will receive a random primary weapon (overrides the base item)
    but VIPs will receive the VIP weapon (overrides the base and random item).
    2. Example: if you configure a base primary weapon and a random SECONDARY weapon and a VIP primary weapon, survivors will receive the base primary weapon and a random secondary weapon.
    VIPs will receive the VIP primary weapon (overrides the base item) and a random secondary weapon.


    Item Replacement Logic
    1. Health Items: These always have priority. If a survivor has an ammo upgrade pack on their back and a health item is configured (base, random or VIP),
    the health item will replace (but not destroy) the upgrade pack.
    2. Default pistol: when a player spawns on the first map of a new campaign, he receives a default pistol. If you configured a secondary weapon selection AND set l4d2_sis_remove_pistol "1", sIs
    will remove (destroy) the default pistol and replace it with the selected secondary weapon. This is done primarily to eliminate pistol drop clutter on large co-op servers when new items are given.
    3. All other weapons/items: sIs looks at each survivor's weapon slots and if they are occupied (other than with a default pistol) it will not give them a new item.
    VIP selections are the exception. If the VIP's existing weapon/item is not the configured VIP item, it will be replaced by the VIP selection, but not destroyed.

    Note: incendiary and explosive ammo upgrades are treated as equal and mutually exclusive. If a survivor has either one of them and your item configuration calls for the other
    ammo upgrade, the existing ammo upgrade will not be replaced. An argument can be made that either incendiary or explosive should have priority (I think explosive should), but I chose
    not to make that judgement call for this first release. If there is sufficient need for a prioritized ammo selection, I will try to add it.


    Using Vip/Admin flags:
    Add one or more admin flags that should receive Vip/admin items to l4d2_sis_vip_flags Multiple flags are accepted, just don't separate them with spaces or other characters.
    Players with any of those flags will receive the VIP/Admin items. This was done to provide greater flexibility for server operators when configuring VIP options.
    To disable the VIP option, just set the VIP item cvars to zero. No need to remove the flag(s) from l4d2_sis_vip_flags setting.

    1. Example: if you set l4d2_sis_vip_flags "a", only players with the "a" flag will recieve VIP items.
    2. Example: if you set l4d2_sis_vip_flags "abo", players with either the "a", "b" or "o" (custom1) flag will receive VIP items.


    Chat Message:
    l4d2_sis_info_message 1 will display a message like this to each player if they are given items. The message is customized to only show the item(s) they received.




    Thank You:
    Dragokas - code review, help and ideas, and the Russian translation.
    nosoop - example code to handle the weapon upgrade bitvec and optimization
    Crasher_3637 - code review and optimization
    Lux - code review
    Silvers - for his great formatting
    l4d Competitive community for creating the original l4d2_weapon_stocks.inc


    Optional dependency for the Knife:
    To use the knife option for a secondary weapon, your must have the [L4D2] Knife Unlock plugin by Silvers installed on your server.
    Smart Item Selector checks for the Knife Unlock plugin and if it is not found, substitutes another melee weapon for the knife.


    Bugs:
    None so far...


    To Do:
    1. Add server message that reports if the knife unlock plugin is not running and which melee weapon will be substituted for the knife.
    2. Release an update with support for l4d.


    Possible Future Upgrade:
    1. Add a menu for VIP/admins to configure a personalized equipment load-out. Data storage method TBD.
    2. Add Silvers game mode toggle code so server operators can chose in which modes sIs is enabled.


    CVars:
    - All cvars, except for the plugin enable, VIP/admin flag,pistol replace, & active weapon slot cvars are set to 0 or off by default for easier configuration.
    PHP Code:
    // [L4D2] Smart Item Selector by Patriot Games
    // Selectively gives items to survivors when they spawn and inlcudes VIP/admin options.
    // ConVars for plugin "l4d2_smart_item_selector.smx"


    /* ==========  Settings  ========== */

    // Is the Smart Item Selector plugin enabled? 0=Plugin off, 1=Plugin on.
    // -
    // Default: "1"
    l4d2_sis_enable "1"

    // Send each player a message informing them which item(s) they recieved?. 0=off, 1=on.
    // -
    // Default: "0"
    l4d2_sis_info_message "0"

    // Weapon slot to equip after all weapons/items are given.
    // 1=primary, 2=secondary, 3=throwable, 4=healthkit, 5=meds
    // -
    // Default: "1"
    // Minimum: "1"
    // Maximum: "5"
    l4d2_sis_lastslot "1"

    // Remove the default pistol before giving another secondary weapon?. 0=No, 1=Yes.
    // Eliminates pistol drop clutter when another secondary is given.
    // -
    // Default: "1"
    l4d2_sis_remove_pistol "1"

    // Survivors with any of these flags will receive VIP/admin items.  Multiple flags are accepted (e.g. "abc")
    // [example admin flags: a=Reservation, b=Generic, c=Kick, d=Ban, o=custom1, etc.]
    // -
    // Default: "a"
    l4d2_sis_vip_flags "a"


    /* ==========  Base Item Selections  ========== */

    // Give survivors a Primary Weapon?
    // 0=disable, 1=pump shotgun, 2=chrome shotgun, 3=spas shotgun, 4=autoshotgun, 5=smg, 6=smg silenced, 7=smg mp5, 8=M16, 9=AK47, 10=Desert rifle, 11=SG552, 12=Hunting rifle, 13=Scout sniper, 14=Military sniper, 15=AWP sniper
    // -
    // Default: "0"
    l4d2_sis_primary_choice "0"

    // Give survivors a Secondary Weapon?
    // 0=disable, 1=magnum pistol, 2=knife (requires [L4D2]Knife Unlock plugin), 3=frying pan, 4=tonfa, 5=crowbar, 6=cricket bat, 7=baseball bat, 8=machete, 9=katana, 10=golf club, 11=fire axe, 12=electric guitar
    // -
    // Default: "0"
    l4d2_sis_secondary_choice "0"

    // Give survivors a Health Item? 0=disable, 1=medkit, 2=defib
    // -
    // Default: "0"
    l4d2_sis_health_choice "0"

    // Give survivors Meds? 0=disable, 1=pills, 2=adrenaline
    // -
    // Default: "0"
    l4d2_sis_meds_choice "0"

    // Give survivors a Throwable? 0=disable, 1=pipe bomb, 2=molotov, 3=bile jar
    // -
    // Default: "0"
    l4d2_sis_throwable_choice "0"

    // Give survivors an Upgrade? 0=disable, 1=laser, 2=incendiary ammo, 3=explosive ammo
    // -
    // Default: "0"
    l4d2_sis_upgrade_choice "0"


    /* ==========  Random Item Selections  ========== */

    // Give survivors a random Primary Weapon? Overrides base primary weapon setting. 0=disable, 1=enable.
    // -
    // Default: "0"
    l4d2_sis_random_primary "0"

    // Give survivors a random Secondary Weapon? Overrides base secondary weapon setting. 0=disable, 1=enable.
    // -
    // Default: "0"
    l4d2_sis_random_secondary "0"

    // Give survivors a random Health item? Overrides base health item setting. 0=disable, 1=enable.
    // -
    // Default: "0"
    l4d2_sis_random_health "0"

    // Give survivors random Meds? Overrides base meds setting. 0=disable, 1=enable.
    // -
    // Default: "0"
    l4d2_sis_random_meds "0"

    // Give survivors a random Throwable? Overrides base throwable setting. 0=disable, 1=enable.
    // -
    // Default: "0"
    l4d2_sis_random_throwable "0"

    // Give survivors a random Upgrade? Overrides base upgrade settings. 0=disable, 1=enable.
    // -
    // Default: "0"
    l4d2_sis_random_upgrade "0"


    /* ==========  VIP Item Selections  ========== */

    // Give VIPs a Primary Weapon? Overrides base and random primary settings.
    // 0=disable, 1=pump shotgun, 2=chrome shotgun, 3=spas shotgun, 4=autoshotgun, 5=smg, 6=smg silenced, 7=smg mp5, 8=M16, 9=AK47, 10=Desert rifle, 11=SG552, 12=Hunting rifle, 13=Scout sniper, 14=Military sniper, 15=AWP sniper
    // -
    // Default: "0"
    l4d2_sis_vip_primary_choice "0"

    // Give VIPs a Secondary Weapon? Overrides base and random secondary settings.
    // 0=disable, 1=magnum pistol, 2=knife (requires [L4D2]Knife Unlock plugin), 3=frying pan, 4=tonfa, 5=crowbar, 6=cricket bat, 7=baseball bat, 8=machete, 9=katana, 10=golf club, 11=fire axe, 12=electric guitar
    // -
    // Default: "0"
    l4d2_sis_vip_secondary_choice "0"

    // Give VIPs a Health Item?  Overrides base and random health settings.
    // 0=disable, 1=medkit, 2=defib
    // -
    // Default: "0"
    l4d2_sis_vip_health_choice "0"

    // Give VIPs Meds?  Overrides base and random meds settings.
    //0=disable, 1=pills, 2=adrenaline
    // -
    // Default: "0"
    l4d2_sis_vip_meds_choice "0"

    // Give VIPs a Throwable?  Overrides base and random throwable settings.
    //0=disable, 1=pipe bomb, 2=molotov, 3=bile jar
    // -
    // Default: "0"
    l4d2_sis_vip_throwable_choice "0"

    // Give VIPs an Upgrade?  Overrides base and random upgrade settings.
    // 0=disable, 1=laser, 2=incendiary ammo, 3=explosive ammo
    // -
    // Default: "0"
    l4d2_sis_vip_upgrade_choice "0" 
    Changes:
    PHP Code:
     v1.2 (5-Mar-2019)
        - 
    Added cvar to choose which weapon is active after items are given.
        - 
    Added code to change game cvar "survivor_respawn_with_guns" value to "0"
        
    Added chat message that prints if the knife is selected but knife unlock plugin is not running
        
    Removed duplicate chainsaw entries in l4d2_weapon_stocks_sis.inc so sIs will compile on sm 1.10
        
    Updated translation file with new knife_warning chat message
        
    Added a formatted l4d2_smart_item_selector.cfg with all cvars in logical groups.

    1.1 (1-Mar-2019)
        - 
    corrected mismatched config and selection values for primary and melee weapons
        
    reformatted wrapped cvar descriptions so all values print in the cfg file

    1.0 
    (24-Feb-2019)
        - 
    Initial release

    Compiling:
    1. Put the l4d2_weapon_stocks_sis.inc include into your \addons\sourcemod\scripting\include\ folder.
    2. Put the plugins .sp file into your scripting folder and compile the plugin.


    Installation: individual files
    1. Put the l4d2_smart_item_selector.smx file in your server's \addons\sourcemod\plugins\ folder.
    2. Put the l4d2_smart_item_phrases.txt file in your server's \addons\sourcemod\translations\ folder.
    3. Restart your server and then set your item preferences in the \cfg\sourcemod\l4d2_smart_item_selector.cfg file.
    4. Restart your server or change the map.

    Installation: zip file
    1. Extract the SmartItemSelector.zip file.
    2. Copy/upload all the files into their respective folders on your server.
    3. Restart your server.
    Attached Files
    File Type: inc l4d2_weapon_stocks_sis.inc (10.5 KB, 529 views)
    File Type: txt l4d2_smart_item.phrases.txt (5.5 KB, 579 views)
    File Type: sp Get Plugin or Get Source (l4d2_smart_item_selector.sp - 581 views - 22.0 KB)
    File Type: smx l4d2_smart_item_selector.smx (15.0 KB, 483 views)
    File Type: cfg l4d2_smart_item_selector.cfg (4.5 KB, 485 views)
    File Type: zip SmartItemSelector_v1.2.zip (28.2 KB, 791 views)

    Last edited by PatriotGames; 03-06-2019 at 22:19. Reason: updated to v1.2, added .zip file
    PatriotGames is offline
    Sev
    Veteran Member
    Join Date: May 2010
    Old 02-26-2019 , 10:41   Re: [l4d2] Smart Item Selector
    Reply With Quote #2

    Good work on this.
    Sev is offline
    Psyk0tik
    Veteran Member
    Join Date: May 2012
    Location: Homeless
    Old 02-27-2019 , 06:32   Re: [l4d2] Smart Item Selector
    Reply With Quote #3

    Oh hey, you finally released it. Great job!
    __________________
    Psyk0tik is offline
    PatriotGames
    AlliedModders Donor
    Join Date: Feb 2012
    Location: root@irs:/# rm -rf /
    Old 02-27-2019 , 13:13   Re: [l4d2] Smart Item Selector
    Reply With Quote #4

    Quote:
    Originally Posted by Sev View Post
    Good work on this.
    Thanks, Sev. Let me know if you have any issues.

    Quote:
    Originally Posted by Crasher_3637 View Post
    Oh hey, you finally released it. Great job!
    Thanks, Crasher_3637. Appreciated you help with the code!
    PatriotGames is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 02-28-2019 , 08:38   Re: [l4d2] Smart Item Selector
    Reply With Quote #5

    Nice plugin, I'm using and it is working very well

    Now some things I think you can improve:

    Some item values from CFG is different from what's based on .sp file, is better to review all of them again
    e.g.:
    chrome shotgun & auto shotgun
    hunting rifle & military & awp
    katana & machete (and most of the melees)

    Missing the number 15 for primary weapons on cfg config
    (that's because when config description is too long, it doesn't print to file you need to cut some words to fill all the numbers and show then on CFG, well that's how I do it)

    And since you check if the knife is unlocked, should be better don't give crowbar if it is not found
    Because can make people confused why, or maybe add this as another cvar or "observation" on cfg file.

    And finally, add which slot the survivor want to have in the ending, right now I always spawn with the config weapons but with the melee weapon on hands, maybe you could add in some sort of order through cvar.
    I would like to have my primary weapon on hands.
    Marttt is online now
    PatriotGames
    AlliedModders Donor
    Join Date: Feb 2012
    Location: root@irs:/# rm -rf /
    Old 03-01-2019 , 18:43   Re: [l4d2] Smart Item Selector
    Reply With Quote #6

    Quote:
    Originally Posted by Marttt View Post
    Nice plugin, I'm using and it is working very well

    Now some things I think you can improve:

    Some item values from CFG is different from what's based on .sp file, is better to review all of them again
    e.g.:
    chrome shotgun & auto shotgun
    hunting rifle & military & awp
    katana & machete (and most of the melees)

    Missing the number 15 for primary weapons on cfg config
    (that's because when config description is too long, it doesn't print to file you need to cut some words to fill all the numbers and show then on CFG, well that's how I do it)

    And since you check if the knife is unlocked, should be better don't give crowbar if it is not found
    Because can make people confused why, or maybe add this as another cvar or "observation" on cfg file.

    And finally, add which slot the survivor want to have in the ending, right now I always spawn with the config weapons but with the melee weapon on hands, maybe you could add in some sort of order through cvar.
    I would like to have my primary weapon on hands.
    Hi Marttt,

    Thanks for your feedback. Glad the plugin is working well for you so far. Let me make sure I understand your suggestions:

    Quote:
    Some item values from CFG is different from what's based on .sp file, is better to review all of them again
    You are correct. I made changes in the cvar values but did not carry them to the switch statement. I'll fix this right away.

    Quote:
    Missing the number 15 for primary weapons on cfg config
    I'll try to shorten the cvar description so all of the values will print in the cfg file.

    Quote:
    And since you check if the knife is unlocked, should be better don't give crowbar if it is not found
    Because can make people confused why, or maybe add this as another cvar or "observation" on cfg file.
    It was an attempt to give the survivors some melee weapon if the knife was configured without the knife unlock plugin running on the server. Would you rather the survivors don't get a melee weapon in that case?

    Quote:
    And finally, add which slot the survivor want to have in the ending, right now I always spawn with the config weapons but with the melee weapon on hands, maybe you could add in some sort of order through cvar. I would like to have my primary weapon on hands.
    This sounds like a "nice to have" feature. I'll think about it.

    Thanks again,
    Patriot
    PatriotGames is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 03-01-2019 , 22:28   Re: [l4d2] Smart Item Selector (v1.1) [1-Mar-2019]
    Reply With Quote #7

    Thanks Patriot.

    Quote:
    It was an attempt to give the survivors some melee weapon if the knife was configured without the knife unlock plugin running on the server. Would you rather the survivors don't get a melee weapon in that case?
    As a suggestion, you can:
    1) Create a cvar on cfg to let the admin choose which melee should equip in case the knife plugin is not found (0 = don't get a melee weapon)
    or
    2) Just add this as a note on the CFG file (and in the first topic), maybe something like this...
    PHP Code:
    ... 2=knife (requires [L4D2]Knife Unlock pluginreplaced by 8=machete if plugin is not found)... 
    (and maybe add some console message that the plugin was not found when knife is selected on cfg)

    I think number 2 is enough, but number 1 gives a little more flexibility.
    Since I don't usually use a knife, this is not a problem for me.
    IMO, is better to give some melee when specified than don't give. (as is now)

    Note: I changed the tonfa to a machete in the sample, since the weapon attributes are more similar to the knife.

    Quote:
    This sounds like a "nice to have" feature. I'll think about it.
    Well, this is just because I spent most of the time using the slot1 (primary) on map start than the slot2 (secondary), to change this you can create a convar to specify which slot (1/primary or 2/secondary) to fire later on the code, so the client gonna start with this set.

    Something like this maybe:

    Code:
    if (g_cvStartSlot == 1)
    {
    SelectSecondary(client,bIsVip)
    SelectPrimary(client,bIsVip)
    }
    else
    {
    SelectPrimary(client,bIsVip)
    SelectSecondary(client,bIsVip)
    }
    Or just move primary code to below the secondary

    Anyway thanks, your plugin is really helpful and works great.

    Last edited by Marttt; 11-11-2020 at 16:02.
    Marttt is online now
    Psyk0tik
    Veteran Member
    Join Date: May 2012
    Location: Homeless
    Old 03-01-2019 , 23:05   Re: [l4d2] Smart Item Selector (v1.1) [1-Mar-2019]
    Reply With Quote #8

    You don't need to rearrange anything. Here's some code based on the one I use for the Enforce ability in my Super Tanks++ plugin.

    PHP Code:
    ConVar g_cvLastSlot;

    public 
    void OnPluginStart()
    {
            
    g_cvLastSlot CreateConVar("l4d2_sis_lastslot""1""Weapon slot to equip after all weapons are given."_true1.0true5.0);
    }

    public 
    Action OnPlayerRunCmd(int clientintbuttonsintimpulsefloat vel[3], float angles[3], intweaponintsubtypeintcmdnuminttickcountintseedint mouse[2])
    {
            if (!
    IsLivingSurvivor(client) || !g_bLast[client])
            {
                    
    g_bLast[client] = false// Make sure to reset it.
                    
    return Plugin_Continue;
            }

            if (
    g_bLast[client])
            {
                    
    g_bLast[client] = false// Disable so player isn't stuck on the same slot.
                    
    weapon GetPlayerWeaponSlot(clientg_cvLastSlot.IntValue 1); // Slot numbers are 0-4 so it must be slot - 1 (ex. 5th slot = 5 - 1 = 4)
            
    }

            return 
    Plugin_Continue;
    }

    static 
    void CheckForItems(int clientbool bIsVip)
    {
            
    // Put this at the very bottom.
            
    g_bLast[client] = true// Enable this to be used for toggling.

    __________________
    Psyk0tik is offline
    PatriotGames
    AlliedModders Donor
    Join Date: Feb 2012
    Location: root@irs:/# rm -rf /
    Old 03-01-2019 , 23:20   Re: [l4d2] Smart Item Selector (v1.1) [1-Mar-2019]
    Reply With Quote #9

    Quote:
    Originally Posted by Marttt View Post
    Thanks Patriot.



    As a suggestion, you can:
    1) Create a cvar on cfg to let the admin choose which melee should equip in case the knife plugin is not found (0 = don't get a melee weapon)
    or
    2) Just add this as a note on the CFG file (and in the first topic), maybe something like this...
    [PHP]... 2=knife (requires [L4D2]Knife Unlock plugin, replaced by 8=machete if plugin is not found).../PHP]

    (and maybe add some console message that the plugin was not found when knife is selected on cfg)

    I think number 2 is enough, but number 1 gives a little more flexibility.
    Since I don't usually use a knife, this is not a problem for me.
    IMO, is better to give some melee when specified than don't give. (as is now)

    Note: I changed the tonfa to a machete in the sample, since the weapon attributes are more similar to the knife.



    Well, this is just because I spent most of the time using the slot1 (primary) on map start than the slot2 (secondary), to change this you can create a convar to specify which slot (1/primary or 2/secondary) to fire later on the code, so the client gonna start with this set.

    Something like this maybe:

    Code:
    if (g_cvStartSlot == 1)
    {
    SelectSecondary(client,bIsVip)
    SelectPrimary(client,bIsVip)
    }
    else
    {
    SelectPrimary(client,bIsVip)
    SelectSecondary(client,bIsVip)
    }
    Or just move primary code to below the secondary

    Anyway thanks, your plugin is really helpful and works great.
    Thanks again for your suggestions.

    My thinking was the same, better to give them some melee weapon rather than none at all if they don't have the knife unlocked and accidentally select it in the cfg. I chose the crowbar because it is available on all maps, at least according to my testing. Adding a cvar to chose which melee to substitute for the knife would be easy, but I think it might create more issues because of the limited availability of some melee weapons.

    That's a good idea to add a message (probably all chat) about the knife unlock plugin not running, I'll add that to the next release.

    I did a quick test and moved the primary weapon code to the end of the weapon check section, but the primary code wouldn't run due to else statements above it. Besides, if a primary weapon isn't selected and a secondary is, the survivor would still be left holding their secondary. I think the only way to handle this is to manipulate the survivor's active weapon.

    Have fun and let me know if you uncover anymore issues.

    Patriot
    PatriotGames is offline
    PatriotGames
    AlliedModders Donor
    Join Date: Feb 2012
    Location: root@irs:/# rm -rf /
    Old 03-01-2019 , 23:30   Re: [l4d2] Smart Item Selector (v1.1) [1-Mar-2019]
    Reply With Quote #10

    Quote:
    Originally Posted by Crasher_3637 View Post
    You don't need to rearrange anything. Here's some code based on the one I use for the Enforce ability in my Super Tanks++ plugin.

    PHP Code:
    ConVar g_cvLastSlot;

    public 
    void OnPluginStart()
    {
            
    g_cvLastSlot CreateConVar("l4d2_sis_lastslot""1""Weapon slot to equip after all weapons are given."_true1.0true5.0);
    }

    public 
    Action OnPlayerRunCmd(int clientintbuttonsintimpulsefloat vel[3], float angles[3], intweaponintsubtypeintcmdnuminttickcountintseedint mouse[2])
    {
            if (!
    IsLivingSurvivor(client) || !g_bLast[client])
            {
                    
    g_bLast[client] = false// Make sure to reset it.
                    
    return Plugin_Continue;
            }

            if (
    g_bLast[client])
            {
                    
    g_bLast[client] = false// Disable so player isn't stuck on the same slot.
                    
    weapon GetPlayerWeaponSlot(clientg_cvLastSlot.IntValue 1); // Slot numbers are 0-4 so it must be slot - 1 (ex. 5th slot = 5 - 1 = 4)
            
    }

            return 
    Plugin_Continue;
    }

    static 
    void CheckForItems(int clientbool bIsVip)
    {
            
    // Put this at the very bottom.
            
    g_bLast[client] = true// Enable this to be used for toggling.

    lol! I reply to Marttt that the way to handle this issue is to manipulate the survivor's active weapon and you post some code to do just that...brilliant!

    Thanks, Crasher.
    PatriotGames is offline
    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 20:47.


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