Function help
#1

This fails
pawn Код:
stock splitstring(string[])
{
    new dot;
    dot = strfind(string, ".", false, 0);
    dot = strfind(string, ".", false, dot + 1);
    strdel(string, dot, 128);
    format(string, 128, "%s", string);
    return string;
}
usage
pawn Код:
new string[128];
format(string, sizeof(string), "%s", splitstring("Hello.There.Wazzup.?"));
print(string);
should output
pawn Код:
Hello.There.
like it should delete everything after the 2nd dot (".")
Reply
#2

pawn Код:
stock splitstring(string[])
{
    new dot;
    dot = strfind(string, ".", false, 0);
    strdel(string, dot + 1, sizeof(string));
    return string;
}
maybe that>?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)