Function help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Function help (
/showthread.php?tid=259100)
Function help - Unknown123 - 03.06.2011
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
like it should delete everything after the 2nd dot (".")
Re: Function help -
Donya - 03.06.2011
pawn Код:
stock splitstring(string[])
{
new dot;
dot = strfind(string, ".", false, 0);
strdel(string, dot + 1, sizeof(string));
return string;
}
maybe that>?