Raised This Month: $ Target: $400
 0% 

[INC] advanced.sp and fileIO.sp


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Flynn
Senior Member
Join Date: Sep 2009
Old 09-07-2009 , 13:07   Re: [Extension] advanced.sp and fileIO.sp
Reply With Quote #4

Quote:
Originally Posted by DJ Tsunami View Post
Extensions are C++ plugins extending the functionality of SourceMod, these are includes, so I suggest you change your topic title from [Extension] to [INC] and rename advanced.sp to advanced.inc
It retains the information on the plugin if it's .sp, and also, backwards compatibility with my older plugins. There is nothing stopping people from removing the plugin info and renaming it to .inc.

Code:
#include "fileIO.sp"
Will work for including it.
Quote:
Originally Posted by DJ Tsunami View Post
  • A lot of your loops use i < MaxClients, which should be i <= MaxClients.
  • ReplyToCommand should be used for commands, use PrintToChat for what you want.
  • DisplayCenterTextToAll and DisplayTextToAll are the same as PrintCenterTextAll and PrintToChatAll.
  • FindPlayer does the same as ProcessTargetString, but the latter is more versatile.
  • Use MaxClients instead of 24/25 in FindPlayer, FindPlayerBackwards, FindHighestClientID and CountPlayers.
As said, these functions in advanced.sp are probably mostly redundant functions for more experienced coderss. FileIO simply makes use of the string operators inside advanced.sp for it's own usage.

The 25 cap was because sometimes it would overshoot the actual maxclients with MaxClients and cause IsClientInGame and IsFakeClient to complain/break/spaz-out (they seem to treat bad numbers as faulty and break rather than ignoring them, continuing on and returning false - which is annoying, to say the least).

Feel free to remove/delete unused or useless functions from advanced.sp.

fileIO makes use of:
CountString
CheckStringPrecise
CheckStringVague (which is superposition of StrContains - this is to ensure ordering is consistant)
CheckStringAdaptive
IsLetter (probably null - but I needed my own implementation to avoid any undefined behavior)
IsCharString
FindNumeric

All the others are optional/redundant functions. I've thrown them in, just in-case it's of use to people.

FURTHER NOTE: SaveArticleString/LoadArticleString has never actually been used. It's pretty much redundant and unneeded as performing FindStringStart, adding it's position to that from ReadString, and running ReadString from that position will do the legwork for you.

Last edited by Flynn; 09-07-2009 at 13:15.
Flynn is offline
Send a message via MSN to Flynn Send a message via Skype™ to Flynn
 



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 18:21.


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