AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [INC] Stringator (https://forums.alliedmods.net/showthread.php?t=77383)

SAMURAI16 09-12-2008 07:17

[INC] Stringator
 
1 Attachment(s)
Been bored i decide to post my .inc here

stocks:
PHP Code:

RemoveQuotes(String:str[]) 
NumToString(num,String:str[]) 
ExtractString(const String:source[], startendString:output[128])
StreQIndex(const String:str[], const String:str2[], pos
GetRandomPlayer()
SetChar(String:str[],len,char)
StrStrip(String:str[], iChars)
CustomGetPlayers(players[MAXPLAYERS],pnum,const String:flags[] = ""team = -1)
QuickContain(const String:str[], start 0)
StrCount(const String:str[], FindChar)
StrFindNum(const String:str[],FindChar,iNum)
StrnEqual(const String:str1[],const String:str2[],0)
StrRev(const String:input[], String:output[], maxchars)
bool:Strbrkqt(const String:text[], String:Left[], leftLenString:Right[], rightLen)
ReplaceAll(String:string[], lenString:what[],  String:with[]) 

Will be updated

bl4nk 09-12-2008 14:37

Re: [INC] Stringator
 
I didn't look over everything, but I did notice you made "NumToString". What's the difference between that and using IntToString or FloatToString?

SAMURAI16 09-12-2008 14:47

Re: [INC] Stringator
 
First part of .inc I made before to know the existence of IntToString()
It's almost the same thing; I can't say wich ones works faster

bl4nk 09-12-2008 15:55

Re: [INC] Stringator
 
I imagine IntToString is because it's a native function.

SAMURAI16 09-12-2008 16:03

Re: [INC] Stringator
 
you'll right

-updated with a new stock

SAMURAI16 10-18-2008 05:21

Re: [INC] Stringator
 
updated

BAILOPAN 10-18-2008 22:49

Re: [INC] Stringator
 
You should const-qualifier strings that are inparams and not outparams

i.e. StrRev's "input" -- assuming it's not modified, should be const

SAMURAI16 10-19-2008 01:42

Re: [INC] Stringator
 
I can say done

V0gelz 02-01-2009 16:56

Re: [INC] Stringator
 
sweet stuff m8. thanks

BAILOPAN 02-03-2009 08:58

Re: [INC] Stringator
 
Another comment here: NumToString(num,String:str[]) has no length specifier, meaning it is not possible to bounds check. Using this could result in variable corruption.


All times are GMT -4. The time now is 04:54.

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