10.05.2009, 23:35
I've been messing with one of my scripts all day. I store the object id of an object. Later in the script, I call it to destroy that object. It doesn't. Now, right after I create the object I made it print what the value was. It was 6. Right before I destroy the object, it was 6. Right after I destroyed the object, it was 6. If I set my position to object 6, it puts me right on that object. But for whatever reason, it will not destroy that object. Some of the code around that also doesn't work. The code is getting called to destroy object 6 but it won't. When I was debugging, I added in a print statement to print some values, when I had that print statement in the code, it fixed the destroying part but messed something else up. Something that makes no sense at all to be broken. If adding in a print statement in fixes something, there must be a bug somewhere in sa:mp, pawn, or pawno. Any idea of what is happening?
Edit:I think I have an idea of what's happening but not sure why. I think parts of the code are getting called twice. As in, variables are being assigned to object ids two times. So it destroys the objects but there is one there with a different id so it looks like nothing happened. Any idea of why this might be happening?
Edit:I think I have an idea of what's happening but not sure why. I think parts of the code are getting called twice. As in, variables are being assigned to object ids two times. So it destroys the objects but there is one there with a different id so it looks like nothing happened. Any idea of why this might be happening?