AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Too Many Frags (1.0.3 - 20.05.2013) (https://forums.alliedmods.net/showthread.php?t=216315)

Smatify 05-19-2013 11:12

Too Many Frags (1.0.3 - 20.05.2013)
 
1 Attachment(s)
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 :D

Plugin have to be compiled locally!

Kia 05-19-2013 11:16

Re: Too Much Frags
 
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 


PoLiCe 05-19-2013 11:58

Re: Too Much Frags
 
This Is New.
gj man :D

Smatify 05-19-2013 14:01

Re: Too Much Frags
 
Quote:

Originally Posted by Kia (Post 1954490)
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 (Post 1954535)
This Is New.
gj man :D

Thanks

v3x 05-19-2013 14:02

Re: Too Much Frags
 
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 :P

Smatify 05-19-2013 14:06

Re: Too Much Frags
 
Quote:

Originally Posted by v3x (Post 1954588)
that's how i'd do it :P

I am new at Pawn, I updated my first post an thank you

Kia 05-19-2013 17:35

Re: Too Many Frags
 
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 


Smatify 05-19-2013 17:38

Re: Too Many Frags
 
Quote:

Originally Posted by Kia (Post 1954726)
Updated to Version 1.0.3

It's version 1.0.2 :P

Updated first post

Kia 05-19-2013 17:46

Re: Too Many Frags
 
1 Attachment(s)
Fixed it, also removed my attachment as you reuploaded it.

Updated to Vers. 1.0.3

Changelog
  • Added nvault_close at plugin_end

Smatify 05-20-2013 05:40

Re: Too Many Frags
 
Quote:

Originally Posted by Kia (Post 1954737)
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


All times are GMT -4. The time now is 08:59.

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