HELP:Team Killing
#8

try this one , i think it will work , not sure though

pawn Код:
stock HeadshotCheck(playerid, &Float:x, &Float:y, &Float:z)
{
    new Float:fx,Float:fy,Float:fz;
    GetPlayerCameraFrontVector(playerid, fx, fy, fz);

    new Float:cx,Float:cy,Float:cz;
    GetPlayerCameraPos(playerid, cx, cy, cz);

    for(new Float:i = 0.0; i < 50; i = i + 0.5)
    {
        x = fx * i + cx;
        y = fy * i + cy;
        z = fz * i + cz;

        #if defined SHOWPATH
        CreatePickup(1239, 4, x, y, z, -1);
        #endif

        for(new player = 0; player < SERVER_MAX_PLAYERS; player ++)
        {
            if(IsPlayerConnected(playerid))
            {
                if(player != playerid)
                {
                 if(GetPlayerTeam(player) != GetPlayerTeam(playerid))
                   {
                    if(GetPlayerSpecialAction(player) == SPECIAL_ACTION_DUCK)
                    {
                        if(IsPlayerInRangeOfPoint(player, 0.3, x, y, z))
                        {

                            GameTextForPlayer(player, "~r~Head Shot!", 2000, 2);

                            SetPlayerHealth(player, 0.0);
                            CallRemoteFunction("OnPlayerDeath", "ddd", player, playerid, 34);
                        }
                     }
                   }
                    else
                    {
                    if(GetPlayerTeam(player) != GetPlayerTeam(playerid))
                      {
                        if(IsPlayerInRangeOfPoint(player, 0.3, x, y, z - 0.7))
                        {


                            GameTextForPlayer(player, "~r~Head Shot!", 2000, 2);

                            SetPlayerHealth(player, 0.0);
                            CallRemoteFunction("OnPlayerDeath", "ddd", player, playerid, 34);
                        }
                      }
                   }
               }
           }
       }
   }
    return 1;
}
Reply


Messages In This Thread
HELP:Team Killing - by Mijata - 25.01.2015, 11:13
Re: HELP:Team Killing - by MBilal - 25.01.2015, 11:25
Re: HELP:Team Killing - by Mijata - 25.01.2015, 11:27
Re: HELP:Team Killing - by MBilal - 25.01.2015, 11:29
Re: HELP:Team Killing - by Mijata - 25.01.2015, 11:30
Re: HELP:Team Killing - by MBilal - 25.01.2015, 11:37
Re: HELP:Team Killing - by Mijata - 25.01.2015, 13:23
Re: HELP:Team Killing - by GGW - 25.01.2015, 13:51
Re: HELP:Team Killing - by Mijata - 25.01.2015, 13:53
Re: HELP:Team Killing - by Mijata - 25.01.2015, 14:20

Forum Jump:


Users browsing this thread: 2 Guest(s)