AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Donations v2.0.1 ( 24/04/2014 ) (https://forums.alliedmods.net/showthread.php?t=214892)

Blizzard_87 04-30-2013 23:41

Donations v2.0.1 ( 24/04/2014 )
 
2 Attachment(s)
http://i.imgur.com/66n3m2w.png
( Frags | Money | Weapons | Health | Armor | NVision | Defuse Kit )
v2.0.1
By Blizzard.

ThreadStart
http://i.imgur.com/7qAhOEH.png
Note: Complete Rewrite, Must Have Latest Version Of Amxx 1.8.3 For Compiling!

With this plugin your able to donate almost every item in a players inventory, { Health, Armor, Money, Weapons, Frags, Night Vision, Defuse Kit } ( Excluding Knife ).

From v2.0.0 you are no longer able to set the minimum limit, this ive hardcoded into the plugin to Prevent Bugs/Glitches with donation amounts.

Ive added a Calculator for the categories with amounts, example: if player (B) has $12000 and player (A) donates $6000, then only $4000 will be donated.
prevents player (A) losing $6000 when only $4000 is required to reach player (B) max.

Ive removed the Ask For Donation feature as you can request by using chat.

Ive added feature where if a player is already in the process of recieving a donation no other players can interfere by overlapping the donations.

New: I've added Maximum donation limits.

http://i.imgur.com/05El1bz.png
Say Commands:
*donate ( Opens Donations Main Menu )
*toggledonate ( Toggles Recieving Donations On/Off For Player )

* = "/", "!", "."

http://i.imgur.com/DBtmJHz.png
donate_flags "abcdefg" ( default all enabled )
  • a = health
  • b = armor
  • c = money
  • d = frags
  • e = weapons
  • f = night vision
  • g = defuse kit

donate_limit "-1" ( default unlimited )
  • -1 = unlimited
  • 0 = player either used up all donations that round or plugin is disabled
  • 1 or greater = the amount of times player can donate in one round.

donate_team "0" ( default 0 both teams )
  • 0 = both teams
  • 1 = your team only

donate_admin "0" ( default 0 all players can use )
  • 0 = all players can use menu
  • 1 = only admins with BAN flag "d" can use

donate_hp_max "90" ( default 90 )

donate_ap_max "100" ( default 100 )

donate_money_max "16000" ( default 16000 )

donate_frag_max "10" ( default 10 )
http://i.imgur.com/UEDPtvT.png
Find this section close to top of file line 107
Code:
/*----------------------- -  EDIT MAX VALUES HERE - -----------------------*/ #define MAX_HP      100 #define MAX_AP      100 #define MAX_MONEY   16000 /*----------------------- -  DONT EDIT BELOW HERE - -----------------------*/
Edit the Values For Maximum Amount Allowed In Total ( This Is Different To Max Donation Limit ).
In the case of ZP you should set the max HP to what your plugin is set to.

http://i.imgur.com/zk8g1Uy.png
roymor - Amount Of Donations Idea
Jhob94 - for extra donation types idea
hornet - for majorly helping with optimizing transfer weapons more effectively.
black rose - pointing out places for optimization.

Servers Using This Plugin Here

Change Log

ThreadEnd
.

rasik 05-01-2013 02:18

Re: Donations
 
O.o
nice 1

but i dont think any 1 would give his frags to any 1 :P , not in this world .. and money ?? almost today all sv uses 16000 round money :|

Blizzard_87 05-01-2013 03:14

Re: Donations
 
Quote:

Originally Posted by rasik (Post 1943480)
O.o
nice 1

but i dont think any 1 would give his frags to any 1 :P , not in this world .. and money ?? almost today all sv uses 16000 round money :|

1. thanks.

2. would be good in servers which have gameplay mods which req players to lvl up and gain money frags etc. then they could get friends to help them if they have more money etc... it can be useful.

PoLiCe 05-01-2013 03:48

Re: Donations
 
Nice plugin man,
looking for more from you! :D

Blizzard_87 05-01-2013 03:48

Re: Donations
 
Quote:

Originally Posted by PoLiCe (Post 1943511)
Nice plugin man,
looking for more from you! :D

thanks :fox:

hornet 05-01-2013 04:20

Re: Donations
 
Code:
public client_connect( id ) g_bDonateUsed[ id ] = false; public CSBase_PlayerPost_Spawn( id ) g_bDonateUsed[ id ] = false; public client_disconnect( id ) g_bDonateUsed[ id ] = false;
Right there you've got 3 forwards doing the same thing. Ham_Spawn is called once when player connects so that would be the only one you need.

In some cases you send info in menu_additem() but you don't retrieve it, which means no need to send it. Also, player indexes can change, so when selecting a player you should use the player's userid and send that in menu_additem() instead of player index. Something you've missed aswell is checking to see if the player is still connected - you might donate to the wrong player otherwise.

You may also want to revise your readability with variable names, eg. g_szDonationTarget is numerical.

Blizzard_87 05-01-2013 05:12

Re: Donations
 
Quote:

Originally Posted by hornet (Post 1943521)
Code:
public client_connect( id ) g_bDonateUsed[ id ] = false; public CSBase_PlayerPost_Spawn( id ) g_bDonateUsed[ id ] = false; public client_disconnect( id ) g_bDonateUsed[ id ] = false;
Right there you've got 3 forwards doing the same thing. Ham_Spawn is called once when player connects so that would be the only one you need.

In some cases you send info in menu_additem() but you don't retrieve it, which means no need to send it. Also, player indexes can change, so when selecting a player you should use the player's userid and send that in menu_additem() instead of player index. Something you've missed aswell is checking to see if the player is still connected - you might donate to the wrong player otherwise.

You may also want to revise your readability with variable names, eg. g_szDonationTarget is numerical.


Updated v1.0.1

edited all you have stated apart from the players userid im having trouble getting it working 100% so atm left it at players index.

MLZz3 05-01-2013 05:35

Re: Donations
 
Plugin, "Donate Money" was created...

Blizzard_87 05-01-2013 06:05

Re: Donations
 
Quote:

Originally Posted by MLZz3 (Post 1943557)
Plugin, "Donate Money" was created...

this does both money and frags.

tonykaram1993 05-01-2013 07:14

Re: Donations
 
Maybe add a fee of transfer? Like for example, whenever you transfer any amount of money/frags, the fee will be 100$/5 frags for example


All times are GMT -4. The time now is 01:18.

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