01.02.2009, 22:41
Is there anyway to compare a String with a Variable?
Originally Posted by JeNkStAX
Is there anyway to compare a String with a Variable?
|
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;
}
format(timedate, sizeof(timedate), "%d%d%d%d%d", svrsec, svrmin, svrhr, svrday, svrmonth); if(AccountInfo[playerid][Jail] >= timedate)
Originally Posted by Donny
Format both into strings and compare them.
|
format(timedate, sizeof(timedate), "%d%d%d%d%d", svrsec, svrmin, svrhr, svrday, svrmonth);
gettime(svrhr,svrmin,svrsec); getdate(svryear,svrmonth,svrday); format(timedate, sizeof(timedate), "%d%d%d%d%d", svrsec, svrmin, svrhr, svrday, svrmonth);