strreplace - 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)
+--- Thread: strreplace (
/showthread.php?tid=456770)
strreplace -
Sellize - 07.08.2013
Код:
stock strreplace(string[], find, replace)
{
for(new i = 0; i < sizeof(string[i]); i++)
{
if(string[i] == find)
{
string[i] = replace;
}
}
}
I get this error at the red line:
Quote:
error 080: unknown symbol, or not a constant symbol (symbol "i")
|
Re: strreplace -
Misiur - 07.08.2013
pawn Код:
for(new i = 0; i < sizeof(string[i]); i++)
//Nope
for(new i = 0, j = strlen(string); i != j; i++)