Raised This Month: $51 Target: $400
 12% 

BoostSlap [v1.5]


Post New Thread Reply   
 
Thread Tools Display Modes
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-04-2012 , 00:32   Re: HnS-VIP Boost [v1.0]
Reply With Quote #11

Quote:
Originally Posted by Ex1ne View Post
What do you mean?
I mean that as long as you were checking szBoost[id] against a hardcoded number, it was better to check this in first place before you had to use natives to make other checks.
Now you are using a native (get_pcvar_num) to check against szBoost[id] so it doesn't matter anymore when you check it.
And also, a common way of cmd_access usage is to make that check in first place, unless you have a good reason to do another way.

amx_boostallow is not needed, cmd_access is just perfect for the job.



PHP Code:
    new mode get_pcvar_num(g_Mode)
    switch(
mode
->
PHP Code:
    switch( get_pcvar_num(g_Mode) ) 



Don't use register_concmd for an only client command, register_concmd handles client + server commands, use register_clcmd instead.


About the hungarian notation, sz prefix implies that the variable is holding a string, so reading your code and seeing szBoost we would assume that it is something like "blabla", but this array is not a string and contains only integers, like {0, 0, 5, 3, 5, etc...}, so if you keep hungarian notation, better to name it iBoost or if you want to also show that it is a global variable it's better to use g_iBoost.
If you don't keep hungarian notation you can just name it boost, or some coders use cap as first letter when variable are global so it would be Boost

new Booosts[id]
new g_iBoosts[id]

Your choice.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-04-2012 at 00:36.
ConnorMcLeod is offline
Ex1ne
Senior Member
Join Date: Oct 2011
Location: Norway
Old 01-11-2012 , 03:52   Re: BoostSlap [v1.3]
Reply With Quote #12

@Groven, Tnx

@ConnorMcLeod, I did the mode thing and the hungarian notation thing aswell
*Update*
__________________

Last edited by Ex1ne; 01-13-2012 at 10:30.
Ex1ne is offline
Old 01-17-2012, 04:14
reko_o
This message has been deleted by xPaw. Reason: Flooding "thanks" posts
Ex1ne
Senior Member
Join Date: Oct 2011
Location: Norway
Old 01-25-2012 , 16:38   Re: BoostSlap [v1.5]
Reply With Quote #13

Please unapprove this. I regret even posting this plugin even tho it has helped me much in coding plugins.
__________________
Ex1ne is offline
leonard19941
Veteran Member
Join Date: Jun 2011
Old 01-27-2012 , 09:38   Re: BoostSlap [v1.5]
Reply With Quote #14

good job
__________________

Last edited by leonard19941; 01-27-2012 at 09:38.
leonard19941 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 02-03-2012 , 12:46   Re: BoostSlap [v1.5]
Reply With Quote #15

DUTCH Translation

Code:
[nl]
ROUND = %s Je kan jezelf maar %i keer boosten per ronde.
ACCESS = Dit commando is momenteel uitgeschakeld
AMX_BOOST = %s %s heeft %s geboost!
TEAM = %s %s heeft %s spelers geboost.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 05:29.


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