Raised This Month: $32 Target: $400
 8% 

Too Many Frags (1.0.3 - 20.05.2013)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
Smatify
Senior Member
Join Date: Nov 2012
Location: Where ever you want
Old 05-19-2013 , 11:12   Too Many Frags (1.0.3 - 20.05.2013)
Reply With Quote #1

Too Many Frags1.0.3

See Servers running this plugin

[ Description ]
Code:
With this plugin you can prevent that pro's scare off other players by restricting the primary weapons.
[ CVars ]
Code:
• tmf_mode // (default : 1) - <0 = disables the plugin || 1 = controlled by difference || 2 = controlled by K/D>
• tmf_difference // (default: 10) - <Specify the difference between frags and deaths>
• tmf_kills_per_death // (default: 1.5) - <Specify the k/d>
[ Some Informations ]

This plugin requires now additional includes, more information here (also in plugin)
PHP Code:
#tryinclude <cstrike_pdatas>  

#if !defined _cbaseentity_included  
#assert Cstrike Pdatas and Offsets library required! Read the below instructions:   \  
1. Download it at forums.alliedmods.net/showpost.php?p=1712101#post1712101    
2. Put it into amxmodx/scripting/include/ folder  
3. Compile this plugin locally
detailswiki.amxmodx.org/index.php/Compiling_Plugins_%28AMX_Mod_X%29  
4. Install compiled plugin
detailswiki.amxmodx.org/index.php/Configuring_AMX_Mod_X#Installing  
#endif 
[ Credits ]
Code:
• UnitedDevs Team
• -=[DAG]=- - Original Idea
• v3x - Updating the "is_user_overlimit"
• ConnorMcLeod	- For his RemovePlayerSlotsItem function.
• Exolent	- For his GetWeaponFromSlot function.
[ Changelog ]
Code:
Version 1.0.3
       • Added nvault_close at plugin_end

Version 1.0.2
       • Renamed from "Too Much Frags" to "Too Many Frags"
       • Updating the Code
       • Added Vault Saving for saving "Too many Frags" for a map.
       • Fixed "Reliable Overflow"-Bug
Version 1.0.1
       • Updating the Code

Version 1.0.0
       • First release
[ To-Do ]
Code:
• Save the frags / deaths for reconnect
• Make plugin only for de_* and cs_* - maps // Should I? I don't know :S
Sorry for my bad english

Plugin have to be compiled locally!
Attached Files
File Type: sma Get Plugin or Get Source (too_many_frags_1_0_3.sma - 915 views - 8.4 KB)
__________________
Selling Hosting stuff such as Webspace and Game- & VoiceServer

I'm also selling Steam Keys.
For more informations, contact me.

(Homepage is under development)

Last edited by Smatify; 06-12-2013 at 07:58.
Smatify is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-19-2013 , 11:16   Re: Too Much Frags
Reply With Quote #2

Quote:
if(get_pcvar_num(cvar_mode) == 0)
else if(get_pcvar_num(cvar_mode) == 1)
else if(get_pcvar_num(cvar_mode) == 2)
Use case and switch instead of multiple if-statements.

PHP Code:
{
            return 
true
        

->

PHP Code:
          return true 
For one line you can use TAB instead of using brackets.

PHP Code:
new user_name[33
Do that in the function, not in global as you use it only there.

In stock is_user_overlimit(id)
PHP Code:
 return PLUGIN_CONTINUE 
->
PHP Code:
 return PLUGIN_HANDLED 
__________________

Last edited by Kia; 05-19-2013 at 11:19.
Kia is offline
PoLiCe
Senior Member
Join Date: Apr 2013
Location: Xen™
Old 05-19-2013 , 11:58   Re: Too Much Frags
Reply With Quote #3

This Is New.
gj man
__________________
PoLiCe is offline
Send a message via MSN to PoLiCe Send a message via Skype™ to PoLiCe
Smatify
Senior Member
Join Date: Nov 2012
Location: Where ever you want
Old 05-19-2013 , 14:01   Re: Too Much Frags
Reply With Quote #4

Quote:
Originally Posted by Kia View Post
Use case and switch instead of multiple if-statements.

PHP Code:
{
            return 
true
        

->

PHP Code:
          return true 
For one line you can use TAB instead of using brackets.

PHP Code:
new user_name[33
Do that in the function, not in global as you use it only there.

In stock is_user_overlimit(id)
PHP Code:
 return PLUGIN_CONTINUE 
->
PHP Code:
 return PLUGIN_HANDLED 
Updated first post

Changelog:
Code:
Version 1.0.1
       • Updating the Code
Quote:
Originally Posted by PoLiCe View Post
This Is New.
gj man
Thanks
Smatify is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-19-2013 , 14:02   Re: Too Much Frags
Reply With Quote #5

Code:
stock is_user_overlimit(id) {     if(get_pcvar_num(cvar_mode) == 0)     {         return PLUGIN_HANDLED     }     else if(get_pcvar_num(cvar_mode) == 1)     {         if(get_user_frags(id) - get_user_deaths(id) >= get_pcvar_num(cvar_differ))         {             return true         }         else         {             return false         }     }     else if(get_pcvar_num(cvar_mode) == 2)     {         if(get_user_frags(id) / get_user_deaths(id) >= get_pcvar_num(cvar_kd))         {             return true         }         else         {             return false         }     }     return PLUGIN_CONTINUE }
=>
Code:
stock bool:is_user_overlimit(id) {     new pcvar_mode = get_pcvar_num(cvar_mode)     if(!pcvar_mode || !is_user_connected(id))         return false     new frags = get_user_frags(id)     new deaths = get_user_deaths(id)     switch(pcvar_mode)     {         case 1:         {             if(frags - deaths >= get_pcvar_num(cvar_differ))                 return true         }         case 2:         {             if(frags / deaths >= get_pcvar_num(cvar_kd))                 return true         }     }     return false }

that's how i'd do it
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Smatify
Senior Member
Join Date: Nov 2012
Location: Where ever you want
Old 05-19-2013 , 14:06   Re: Too Much Frags
Reply With Quote #6

Quote:
Originally Posted by v3x View Post
that's how i'd do it
I am new at Pawn, I updated my first post an thank you

Last edited by Smatify; 05-19-2013 at 14:06.
Smatify is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-19-2013 , 17:35   Re: Too Many Frags
Reply With Quote #7

Updated to Version 1.0.2

Changelog :
  • Added Vault Saving for saving "Too many Frags" for a map.
  • Optimized code used for checking weapon.
  • Fixed "Reliable Overflow"-Bug

Additional Credits go to:
  • ConnorMcLeod - For his RemovePlayerSlotsItem function.
  • Exolent - For his GetWeaponFromSlot function.

This plugin requires now additional includes, more information here (also in plugin)
PHP Code:
#tryinclude <cstrike_pdatas> 

#if !defined _cbaseentity_included 
#assert Cstrike Pdatas and Offsets library required! Read the below instructions:   \ 
1. Download it at forums.alliedmods.net/showpost.php?p=1712101#post1712101   
2. Put it into amxmodx/scripting/include/ folder 
3. Compile this plugin locally
detailswiki.amxmodx.org/index.php/Compiling_Plugins_%28AMX_Mod_X%29 
4. Install compiled plugin
detailswiki.amxmodx.org/index.php/Configuring_AMX_Mod_X#Installing 
#endif 
__________________

Last edited by Kia; 05-19-2013 at 17:45.
Kia is offline
Smatify
Senior Member
Join Date: Nov 2012
Location: Where ever you want
Old 05-19-2013 , 17:38   Re: Too Many Frags
Reply With Quote #8

Quote:
Originally Posted by Kia View Post
Updated to Version 1.0.3
It's version 1.0.2

Updated first post
__________________
Selling Hosting stuff such as Webspace and Game- & VoiceServer

I'm also selling Steam Keys.
For more informations, contact me.

(Homepage is under development)
Smatify is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-19-2013 , 17:46   Re: Too Many Frags
Reply With Quote #9

Fixed it, also removed my attachment as you reuploaded it.

Updated to Vers. 1.0.3

Changelog
  • Added nvault_close at plugin_end
Attached Files
File Type: sma Get Plugin or Get Source (too_many_frags_1_0_3.sma - 790 views - 7.6 KB)
__________________

Last edited by Kia; 05-20-2013 at 04:04.
Kia is offline
Smatify
Senior Member
Join Date: Nov 2012
Location: Where ever you want
Old 05-20-2013 , 05:40   Re: Too Many Frags
Reply With Quote #10

Quote:
Originally Posted by Kia View Post
Updated to Vers. 1.0.3
Thanks, updated first post

Btw, UnitedDevs = Kia, oxygen, quilhos and me. Thats why kia is not in the credits
__________________
Selling Hosting stuff such as Webspace and Game- & VoiceServer

I'm also selling Steam Keys.
For more informations, contact me.

(Homepage is under development)

Last edited by Smatify; 05-20-2013 at 06:04.
Smatify 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 22:26.


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