Simple snippet that will make a M4 leave an explosion wherever its last shot lands:
PHP Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
? ??if(weaponid == WEAPON_M4)
? ??{
? ? ? ??new Float:dummy_float,Float:fHitPosX,Float:fHitPosY,Float:fHitPosZ;
? ? ? ??GetPlayerLastShotVectors(playerid,dummy_float,dummy_float,dummy_float,fHitPosX,fHitPosY,fHitPosZ);
? ? ? ??CreateExplosion(fHitPosX,fHitPosY,fHitPosZ,0,10.0);
? ??}
? ? return 1;
}
Stoned Ape