SA-MP Forums Archive
Help | someone can give stock.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help | someone can give stock.. (/showthread.php?tid=370498)



Help | someone can give stock.. - avivelkayam - 20.08.2012

Hello !

in my past i see the stock strequal its like strcmp
i tried to search him but i dont found

some one can give me this stock?


Re: Help | someone can give stock.. - Cjgogo - 20.08.2012

pawn Код:
stock bool:strequals(const str1[], const str2[], bool:ignorecase = false) {
    new
        c1 = (str1[0] > 255) ? str1{0} : str1[0],
        c2 = (str2[0] > 255) ? str2{0} : str2[0]
    ;
   
    if (!c1 != !c2)
        return false;
   
    return !strcmp(str1, str2, ignorecase);
}
USAGE:
pawn Код:
if (strequals("orange", "apple")) // false
if (strequals("", "apple")) // false
if (strequals("apple", "apple")) // true
if (strequals(!"apple", "apple")) // true
if (strequals(!"apple", "Apple", .ignorecase = true)) // true



Re: Help | someone can give stock.. - avivelkayam - 20.08.2012

THNX Man