01.02.2009, 22:57
Quote:
Originally Posted by JeNkStAX
Is there anyway to compare a String with a Variable?
|
pawn Код:
StrFloatCmp(str:String, Float:Float, Chars) // Float is the float to compare, chars is the number of characters to compare
{
new StrFloat[10];
format(StrFloat, sizeof(StrFloat), "%f", Float);
if (strcmp(StrFloat, String, true, Chars) == 0) return 0;
return 1;
}
StrIntCmp(str:String, int:Integer, Chars) // Float is the float to compare, chars is the number of characters to compare
{
new StrInt[10];
format(StrInt, sizeof(StrInt), "%i", Integer);
if (strcmp(StrInt, String, true, Chars) == 0) return 0;
return 1;
}