AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   AMXX Buy Health (https://forums.alliedmods.net/showthread.php?t=149714)

rrduna 02-10-2011 17:22

AMXX Buy Health
 
1 Attachment(s)
AMXX Buy Health


AMXX Buy Health v2.0
Copyright © 2011, Duna. All rights reserved.

Description:
With this plugin, customers can buy health (hp) through a menu.
There are two options for health: 100 HP for standard costing, actual 5000
and 150 HP that also by default, it costs 8000 dollars.
A good plugin and where it is recommended to be used in servers 4fun.

Cvars:
amx_buyhp_100cost (cash price for 100 hp)
amx_buyhp_150cost (cash price for 150 hp)

Command to the client:
say /buyhp


Enjoy!

Destro- 02-10-2011 17:45

Re: AMXX Buy Health
 
if (key == 0)
//...
if (key == 1)
//...

for

if (!key)
//...
else if (key == 1
//...

pd:This is practically a sample plugin.

pd2:Sorry for mi English.

rrduna 02-10-2011 17:48

Re: AMXX Buy Health
 
to yes, I'll do it!

NucL3ra 02-10-2011 19:27

Re: AMXX Buy Health
 
You should put 1 by 1 HP to buy.
Like -- buy 10 HP, buy 25HP, not just 100 and 150 and buy of as much money as I have.

rrduna 02-10-2011 19:32

Re: AMXX Buy Health
 
No! I wrote so by reason of being a common plugin which will be used on standard servers, and having only two options, does not alter much the games.
Imagine a player with 1000 hp, while the other will not have the same amount of money or health, would be incompatible with others.

jarmenz 02-11-2011 04:28

Re: AMXX Buy Health
 
What are you talking about, rrduna? You can just check if the player has exceeded the maximum hp he can buy, for example :
if ( <player hp >= 200)
_printmsgtoclient("You reached the limit...") // etc.

NucL3ra, is right... more options equals more interesting gameplay :)!

rrduna 02-13-2011 15:55

Re: AMXX Buy Health
 
Good! What I meant was that, my only containing only two options is easier because it is nothing too advanced for standard servers.

Kreation 02-16-2011 22:37

Re: AMXX Buy Health
 
Think about this. You just spawned and start out with the default 100 hp. You have 8000$ and you buy the 150 hp from your plugin. Then that person has 250 hp and has the advantage over everyone. Making it that much harder to kill him, especially if he is a good/decent player. If you make more options for it, the opposite team might not be at as much of a disadvantage and have a chance to win the round.

ConnorMcLeod 02-17-2011 03:51

Re: AMXX Buy Health
 
Don't use fakemeta_util to set health, use fun module.
Use switch statement for menu key check.
Use pcvars.
Cache pcvar values.
Don't use a colorchat function when the function is only used once, the loop is also not needed.

About features, plugin is too static, you could for example put a config file with settings (1 line for HP amount and price ) so users could put as many menu option as they would like).

About public cvar, don't you think it is a bit much for such a plugin ?

Arkshine 03-05-2011 13:33

Re: AMXX Buy Health
 
More than 15 days have passed and no changes have been made as suggested by ConnorMcLeod.

Unapproved.


All times are GMT -4. The time now is 21:10.

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