01.12.2013, 06:46
Not sure, but I believe there's an include released for that already.
It's pretty easy, IMO. You just need to know some basic maths and PAWN knowledge.
Anyways, here's some small code (using this include) that destroys objects upon shooting them:
Quote:
|
Nice and awesome, i wanted an include like this, But i don't know how to make one...
|
Anyways, here's some small code (using this include) that destroys objects upon shooting them:
pawn Код:
public OnPlayerShootPos(playerid, Float:x, Float:y, Float:z, Float:distance)
{
new Float:fObjectPos[3];
for (new i = 0; i < MAX_OBJECTS; i ++)
{
if (!IsValidObject(i))
continue;
GetObjectPos(i, fObjectPos[0], fObjectPos[1], fObjectPos[2]);
fObjectPos[0] -= x;
fObjectPos[1] -= y;
fObjectPos[2] -= z;
if ((fObjectPos[0] * fObjectPos[0]) + (fObjectPos[1] * fObjectPos[1]) + (fObjectPos[2] * fObjectPos[2]) < 40.0)
{
DestroyObject(i);
break;
}
}
return 1;
}

