Code:
/*****************************************************************
* StrToBool
*
* @breif Converts a string (1|0|on|off) to bool
* @params String:input string bool
* @return true|false
*****************************************************************/
bool:StrToBool(String:input[])
{
if(StrContains(input, "1") != -1 || StrContains(input, "on") != -1)
{
return true;
}
else if(StrContains(input, "0") != -1 || StrContains(input, "off") != -1)
{
return false;
}
return false;
// YAY!
}
Note for this to work you MUST leave in '// YAY!' without it, it wont compile
I know its a simple function, but meh, saves someone else needing to type it all out
Hope its as usefull as the title makes out