stock strcmpEx(const string1[], const string2[], bool:ignorecase=false, length=cellmax) { if((!strlen(string1) || !strlen(string2))) return -1; // JoeBullet's brain -_- Written in 10 sec lol return strcmp(string1, string2, ignorecase, length); }
if(!strcmp(cmd, "/strcmpex", true)) { if(strcmpEx(" ","How are you?",false)==0) return SendClientMessage(playerid, COLOR_YELLOW, "Dont Work !!!"); else return SendClientMessage(playerid, COLOR_YELLOW, "Work :))"); }
Originally Posted by JoeBullet
I didn't know where to post it so i did here.. If it is wrong section , mods please move it to correct...
Here is code: Код:
stock strcmpEx(const string1[], const string2[], bool:ignorecase=false, length=cellmax) { if((!strlen(string1) || !strlen(string2))) return -1; // JoeBullet's brain -_- Written in 10 sec lol return strcmp(string1, string2, ignorecase, length); } Код:
if(!strcmp(cmd, "/strcmpex", true)) { if(strcmpEx(" ","How are you?",false)==0) return SendClientMessage(playerid, COLOR_YELLOW, "Dont Work !!!"); else return SendClientMessage(playerid, COLOR_YELLOW, "Work :))"); } |
Originally Posted by JoeBullet
I didn't know where to post it so i did here.. If it is wrong section , mods please move it to correct...
Here is code: Код:
stock strcmpEx(const string1[], const string2[], bool:ignorecase=false, length=cellmax) { if((!strlen(string1) || !strlen(string2))) return -1; // JoeBullet's brain -_- Written in 10 sec lol return strcmp(string1, string2, ignorecase, length); } Код:
if(!strcmp(cmd, "/strcmpex", true)) { if(strcmpEx(" ","How are you?",false)==0) return SendClientMessage(playerid, COLOR_YELLOW, "Dont Work !!!"); else return SendClientMessage(playerid, COLOR_YELLOW, "Work :))"); } |
// strcmp() returns are fucked, this is an override to fix returns
// will return 1/true if strings are equal
public strcomp(str1[],str2[],bool:ignorecase)
{
if ((!strlen(str1)) && (!strlen(str2))) return 1;
if (!strlen(str1)) return 0;
if (!strlen(str2)) return 0;
if (strcmp(str1,str2,ignorecase) == 0)
{
return 1;
}
return 0;
}
stock strcmpEx(const string1[], const string2[], bool:ignorecase=false, length=cellmax)
{
if((!strlen(string1) && !strlen(string2))) return 0; // Added this, i'll explain
if((!strlen(string1) || !strlen(string2))) return -1; // JoeBullet's brain -_- Written in 10 sec lol
return strcmp(string1, string2, ignorecase, length);
}