Kod php:
stock setColor(string[], len)
{
if (contain(string, "!t") != -1 || contain(string, "!g") != -1 || contain(string,"!n") != -1)
{
//Some nice shiny colors ^^
replace_all(string, len, "!t", "^x03");
replace_all(string, len, "!n", "^x01");
replace_all(string, len, "!g", "^x04");
//Work away a stupid bug
format(string, len, "^x01%s", string);
}
}
stock getString(mode, type, string[], len, one, two = 0)
{
//server_print("mode: %d type: %d len: %d one: %d two %d", mode, type, len, one, two);
//Uses the fact that a string is passed by reference
if(mode == COND)
{
if(type == NORM_AD)
{
copy(string, len, normConditions[one][two]);
} else//if(type = SAY_AD)
{
copy(string, len, sayConditions[one][two]);
}
} else//if(mode == STORE)
{
if(type == NORM_AD)
{
copy(string, len, normStore[one]);
} else//if(type == SAY_AD)
{
copy(string, len, sayStore[one][two]);
}
}
}
stock setString(mode, type, string[], one, two = 0)
{
if(mode == COND)
{
if(type == NORM_AD)
{
copy(normConditions[one][two], 31, string);
} else//if(type = SAY_AD)
{
copy(sayConditions[one][two], 31, string);
}
} else//if(mode == STORE)
{
if(type == NORM_AD)
{
copy(normStore[one], 127, string);
} else//if(type == SAY_AD)
{
copy(sayStore[one][two], 127, string);
}
}
}