06.11.2015, 05:08
(
Last edited by codectile; 06/11/2015 at 06:01 AM.
)
Quote:
With that example you would actually be better only updating the capsule position when you actually need to make a check right ?
|
Code:
stock IsPlayerInContact(playerid) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); /* *0.3 is the radius and 0.9 is the height and I think that, *the second parameter is of no use so I'll remove it in the next update */ CR_CreateCapsuleCharacter(playerid, 1, x, y, z, 0.3, 0.9); //you can define your own radius and height new check = CR_CharacterContactTest(playerid); //I'll try to add this today, most probably CR_DeleteCharacter(playerid); return check; //returns 1 if collision is detected else returns 0 }
Quote:
Yes it can be detected, but not in SA-MP natively.
codectile's plugin would not detect an actual punch on the object, just if the player's surrounding capsule would contact the object. You could also use a ColAndreas ray cast for it, but still that is not detecting it either. The best solution would be a client side plugin, which obviously isn't ideal. |
EDIT: for checking a punch, you should use animation checks along with IsPlayerInContact(playerid).