Crashes server after 10 - 11 hours.
#1

Hi, all. This is a occurence that has been applied to my previous gamemode based on Call of Duty, it's got nothing to do with my current.

pawn Код:
stock Lorenc( )
{
    return fixed_function;
}
this simple code here crashes the server I assume, given by crashdetect. And I got to admit, I guess it is indeed.

pawn Код:
#define strcpy(%0,%1,%2)            strcat((%0[0]='\0',%0),%1,%2)
That's the strcpy function I have, anyway.

It prints 2 "lol" comments, weird but still trying to see what's wrong lol. Would be good if I discovered what's wrong so I can open another server, probably.
Reply
#2

I don't know how to use define that well, but isn't this strcpy?:
pawn Код:
stock strcpy(dest[], const source[], maxlength=sizeof dest)
{
    strcat((dest[0] = EOS, dest), source, maxlength);
}
Reply
#3

What's the difference between mine and that? I have doubts that mine may be faster as well

EDIT: I've fixed it, like a boss.
Reply
#4

You shouldn't debug like that. It's better to do something "debug 1" "debug 2" not all the same messages.
Reply
#5

Now I'm not sure how to use define ones but this might solve it it goes by the lengh of the string.... Its like a safe version of it. Its slower I think than yours...

pawn Код:
stock strcpy(dest[], source[])
{
     for (i = 0; i < strlen(source); i ++)
    {
        dest[i] = source[i];
    }
}
Reply
#6

Quote:
Originally Posted by MP2
Посмотреть сообщение
You shouldn't debug like that. It's better to do something "debug 1" "debug 2" not all the same messages.
If you cannot count you can do that, I wont take that idea.

I've fixed the issue guys, no-one has given me the closest answer to this solution thus i'm not giving rep to anyone.

pawn Код:
new log__Text[5][MAX_LOG_STR];
new log__Line[5];
I forgot to increase that by 5 lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)