Weapon-Specific Spawn Protection
4 Attachment(s)
Weapon-Specific Spawn Protection By: nikhilgupta345 Description: This plugin allows you to protect a player from a certain weapon for the first X seconds after he spawns. A .ini file is created where you can place the weapon names that you want to be blocked. CVars:
Installation: Example: Changelog: Credits: |
Re: Weapon-Specific Spawn Protection
- If you let TakeDamage enabled all the time, then remove the task system it is useless, use gametime instead.
- You can't detect hegrenade with your code - If you also want to prevent blood from appearing, you have to hook TraceAttack It could be usefull to have a specific time for each weapon, even if i don't really see the utility of this plugin ;) |
Re: Weapon-Specific Spawn Protection
- You never check if iFile is not zero.
- You don't need to read file after you just created it. |
Re: Weapon-Specific Spawn Protection
Also, compare attacker index with get_maxplayers value instead of MAX_PLAYERS.
|
Re: Weapon-Specific Spawn Protection
Quote:
Quote:
Quote:
|
Re: Weapon-Specific Spawn Protection
Have i missed something or isn't cstrike module used ?
Also if no weapon registered, it is not required to let the plugin run, or at least to register forwards. |
Re: Weapon-Specific Spawn Protection
Quote:
Also prevented forward registration if no weapons were registered. |
Re: Weapon-Specific Spawn Protection
TraceAttack is sent with weapons (knife included), but not with hegrenades ;)
Seems that you need to hook both TraceAttack and TakeDamage. |
Re: Weapon-Specific Spawn Protection
Aww, that's annoying. I'll do it in a bit.
EDIT: Done. |
Re: Weapon-Specific Spawn Protection
You can remove grenade check from TraceAttack (never called).
Code:
You don't need an "else" because you already return the previous statement. Those 2 highlighted checks should be proceded in the other way. 1st check for bit and iProtectWeapons, and the if that check is passed, then do the gametime and cvar checks that need to use natives. I would put all checks in a row but that's your choice : PHP Code:
TraceAttack and TakeDamage are not sent very often, but that's a good habit to take. |
All times are GMT -4. The time now is 20:32. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.