22.06.2015, 19:23
This is just an idea , I didn't test this code so I don't know if it works but you should get the idea of what you can use to make this script.
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
new Float:X, Float:Y, Float:Z;
for(new i; i<MAX_PLAYERS; i++) // Loop through all the players
{
if(IsACop(i)) // Search for players that are cops
{
GetPlayerPos(i, X, Y, Z); // Get the cop's position.
}
}
if(IsPlayerInRangeOfPoint(playerid, 7.0, X, Y, Z)) // Check to see if the player who shot the weapon is near a cop
{
// Do something
}
}