28.07.2012, 15:39
Well I wasn't actually talking about the cannons, but certain attacks :P, but about that piece of code.
You are doing IsPlayerInRangeOfPoint and use the coordinates or tx, ty and tz. I suppose those are the targetcoordinats. But you are making a mistake over here. You are checking whether a player is near the objectcoordinates. So you should use x, y and z instead.
Edit: this if statement shouldn't be closed like: if(..........; like you did.
the right way: if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))
Edit 2: I also see you forgot to add the range.
You are doing IsPlayerInRangeOfPoint and use the coordinates or tx, ty and tz. I suppose those are the targetcoordinats. But you are making a mistake over here. You are checking whether a player is near the objectcoordinates. So you should use x, y and z instead.
Edit: this if statement shouldn't be closed like: if(..........; like you did.
the right way: if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))
Edit 2: I also see you forgot to add the range.