Raised This Month: $ Target: $400
 0% 

Clarity of Script


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Plugin Info:     Modification:   ALL        Category:         
gunblade
New Member
Join Date: Feb 2005
Old 02-11-2005 , 02:35   Clarity of Script
Reply With Quote #1

This is actually an include file that contains some macros that I
think can drastically improve the clarity and readabillity of AMXX
scripts. Consider the function for a console command:

Code:
public eat_player(id, level, cid) {
    ...Check permissions...
    ...Read in args...
    ...Eat the player...
}
so, I have a function that eats a player.... SO?
And just look at that boilerplate code!

With gunblade.inc you can also use:
Code:
concmd eat_player(...Put # of args here) {
...Eat the player...
}
You can access the arguments with args, args_len == # of args
id, level, and cid are implicitly defined.

Notice that this is much more clear:
Here we have a console command that eats a player and take x args
duh!.

Currently gunblade.inc includes concmd, clcmd, and task.
though I'm still learning amxx so I think clcmd and task need more in them.

Enjoy!
Attached Files
File Type: inc gunblade.inc (1.1 KB, 185 views)
gunblade is offline
 



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 19:25.


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