2 ERRORS AGAIN { Sorry for spam but i need help }
#1

I Have now 2 Errors From THis can you help me??

PHP код:
test.pwn(14202) : error 021symbol already defined"strreplace"
test.pwn(14219) : error 021symbol already defined"ret_memcpy" 
Codes>>

Код:
stock strreplace(trg[],newstr[],src[])
{
    new f = 0, s1[MAX_STRING], tmp[MAX_STRING];
    format(s1,sizeof(s1),"%s",src);
    f = strfind(s1,trg);
    tmp[0] = 0;
    while (f>=0)
	{
        strcat(tmp,ret_memcpy(s1, 0, f));
        strcat(tmp,newstr);
        format(s1,sizeof(s1),"%s",ret_memcpy(s1, f+strlen(trg), strlen(s1)-f));
        f = strfind(s1,trg);
    }
    strcat(tmp,s1);
    return tmp;
}
Код:
stock ret_memcpy(source[],index = 0,numbytes)
{
	new tmp[MAX_STRING], i = 0;
	tmp[0] = 0;
	if(index >= strlen(source)) return tmp;
	if(numbytes+index>=strlen(source)) numbytes=strlen(source)-index;
	if(numbytes<=0) return tmp;
	for(i = index; i < numbytes + index; i++)
	{
		tmp[i-index] = source[i];
		if(source[i] == 0) return tmp;
	}
	tmp[numbytes] = 0;
	return tmp;
}
help help help
Reply
#2

try deleting tthose stocks because they are already defined in code before those stocks are extra it will work if it wont you can do undo write here if it works
Reply
#3

Well its simple, read what the error says "symbol already defined". It means you already defined them (you have them 2x or some include makes them for you). Remove those 2 functions (stock).
Reply
#4

Yes i already have

Код:
new ret_memcpy; 
new strreplace;
and yes
Reply
#5

Quote:
Originally Posted by RedRex
Посмотреть сообщение
Yes i already have

Код:
new ret_memcpy; 
new strreplace;
and yes
delete those stocks it will work
Reply
#6

omg where.... im not find it i check all includes + Filterscripts im not find it...
Reply
#7

Quote:
Originally Posted by RedRex
Посмотреть сообщение
I Have now 2 Errors From THis can you help me??

PHP код:
test.pwn(14202) : error 021symbol already defined"strreplace"
test.pwn(14219) : error 021symbol already defined"ret_memcpy" 
Codes>>

Код:
stock strreplace(trg[],newstr[],src[])
{
    new f = 0, s1[MAX_STRING], tmp[MAX_STRING];
    format(s1,sizeof(s1),"%s",src);
    f = strfind(s1,trg);
    tmp[0] = 0;
    while (f>=0)
	{
        strcat(tmp,ret_memcpy(s1, 0, f));
        strcat(tmp,newstr);
        format(s1,sizeof(s1),"%s",ret_memcpy(s1, f+strlen(trg), strlen(s1)-f));
        f = strfind(s1,trg);
    }
    strcat(tmp,s1);
    return tmp;
}
Код:
stock ret_memcpy(source[],index = 0,numbytes)
{
	new tmp[MAX_STRING], i = 0;
	tmp[0] = 0;
	if(index >= strlen(source)) return tmp;
	if(numbytes+index>=strlen(source)) numbytes=strlen(source)-index;
	if(numbytes<=0) return tmp;
	for(i = index; i < numbytes + index; i++)
	{
		tmp[i-index] = source[i];
		if(source[i] == 0) return tmp;
	}
	tmp[numbytes] = 0;
	return tmp;
}
help help help
these stocks you just gave us

try deleting them then compiling
Reply
#8

Hey guys, have a look here: https://sampforum.blast.hk/showthread.php?tid=570635
People keep calling functions stocks so I'm trying to help.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)