Quote:
Originally Posted by BroZeus
It will be buggy at some instances, for example if u do something like this :
pawn Код:
SomeFunc(playerid) // lets say it is called at 01:25:00 { format(string, sizeof(string), "something something"); for(new i = 0; i < 1000;i++)//lets say it takes 4 sec to complete this loop SendClinetMessage(playerid, -1, string); // executed at 01:25:04 caz loops take 4sec return 1; }
SomeOtherFunc()// lets say it is called at 01:25:02 { format(string, sizeof(string), "bla bla bla"); WriteFile("somefile.txt", string); // some imaginary function, clear with its name what it does return 1; }
So now SendClientMessage will send "bla bla bla" instead of what it was suppose to send
So don't do this, people don't create new strings at every function just for like that.
|
Ya you need to reset the string any time you use it.
Or something like this to make it easier to understand with something like
Код:
#define ResetString(%0) %0[0] = '\0'