04.11.2014, 07:09
If I'd put two string parameters next to each other, the strlen of the first one will be zero, for such an unknown reason.
Alright, I will tell you my bitmasking technique.
Command | Effect
/createfaction..........................returns the string length(0)
/createfaction Test...................returns the string length(4) as well
/createfaction Testi..................shows the SPM(playerid, "ERROR: Faction tags consists only of 3 characters!");
/createfaction Testing TST.........returns the string length as zero
pawn Код:
new name[24], tag[3], string1[128];
if(sscanf(params,"ss",name,tag)) return SPM(playerid, "USAGE: /createfaction [name] [tag]");
if(strlen(name) < 5 || strlen(name) > 24) { format(string1, sizeof(string1), "%d",strlen(name)); return SPM(playerid, string1); }
if(strlen(tag) != 3) return SPM(playerid, "ERROR: Faction tags consists only of 3 characters!");
//more code
Command | Effect
/createfaction..........................returns the string length(0)
/createfaction Test...................returns the string length(4) as well
/createfaction Testi..................shows the SPM(playerid, "ERROR: Faction tags consists only of 3 characters!");
/createfaction Testing TST.........returns the string length as zero