Trouble using strmid function
#1

Hi everyone.

After upgrading my server to 0.3b i started to get problems with the strmid function. I'm not sure what's causing it. I have very old functions using it that haven't been changed but now strmid sometimes just doesnt extract it at all.
One example code that has stopped working:
Код:
strmid(PlayerInfo[playerid][pKey], inputtext, 0, strlen(inputtext), 255);
strmid simply deletes any info inside the Destination. After this code executes pKey = "" .
It doesn't ALWAYS happen. But too often to ignore.
Anyone have any ideas what might be causing it?
Reply
#2

is 255 the size of your [pKey] array?
Reply
#3

Check Dialog IDs, maybe you have two dialogs with same ID, and in that duplicated ID dont have inputtext
Reply
#4

No there is no double used dialogs. and the size of pKey is 127. I'm gonna try changing it see what happens.
Reply
#5

I don't know what pKey is in your script, I'm assuming it is a password? I'm a big fan of saving memory by optimizing the size of variables ( ie making them no larger than they need to be )

Regardless of this, you should probably make the last number in your strmid function 127 ( aka sizeof(pkey)
Reply
#6

Try changing the size of pKey to 500 or something.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)