Szerző Téma: body inc  (Megtekintve 858 alkalommal)

Nem elérhető idk28

  • 121
    • Profil megtekintése
body inc
« Dátum: 2016. Augusztus 27. - 12:13:32 »
0 Show voters
sziasztok valaki a body includet át tudná küldeni? forumon 2 topic is van de mind hibás link.. neten meg szarságokat dob ki

body inc
« Válasz #1 Dátum: 2016. Augusztus 27. - 12:17:05 »
0 Show voters
Talán ez?
 

/*
                                                                        Body Part Detection - Detect a player\'ss body part
                                                                                        By Seif
*/
/*x---------------------------------Important-------------------------------------x*/
//**INCLUDES**//
#include <a_samp>
/*x---------------------------------Defining-------------------------------------x*/
#define MAX_DISTANCE_UNIT   100.0   // maximum distance a player can shoot from
//**BODY PARTS**//
#define BODY_PART_HEAD  1
#define BODY_PART_TORSO 2
#define BODY_PART_LEGS  3
/*x---------------------------------CallBacks-------------------------------------x*/
/*
                                                                                        ---[isPlayerAimingBodyPart]---
                        »playerid: the player
                        »bodypart: the body part you want to check
                        *Return: 1 if true, 0 if false
                *-------------------------------------------------------------------*
                | Checks if the player is aiming at any player\'s certain body part.     |
                *-------------------------------------------------------------------*
*/
stock IsPlayerAimingBodyPart(playerid, bodypart)
{
        // Get the camera\'s positions
        new Float:x, Float:y, Float:z;
        new Float:vx, Float:vy, Float:vz;
        new Float:cx, Float:cy, Float:cz;
        GetPlayerCameraFrontVector(playerid, vx, vy, vz);
        GetPlayerCameraPos(playerid, cx, cy, cz);
        // Check if the player is aiming in a certain distance
        for(new Float:d; d < MAX_DISTANCE_UNIT; d += 1.5)
        {
            x = vx*d+cx;
            y = vy*d+cy;
            z = vz*d+cz;
            new Float:dist = floatsqroot((x-cx)*(x-cx)+(y-cy)*(y-cy));
                new Float:offset;
                switch (GetPlayerWeapon(playerid))
                {
                    case 24, 29, 22, 23, 25, 26, 27, 28, 32: offset = 1.1122047500310059125919013005129;
                    case 30, 31: offset = 1.07867820613690007867820613690008;
                    case 33, 34: offset = 1.0;
                }
                new Float:height;
                if (z > cz) height = z-cz;
                else height = cz-z;
                offset *= dist;
                height /= dist;
                new Float:part;
                if (bodypart == BODY_PART_HEAD) part = -0.4;
                else if (bodypart == BODY_PART_TORSO) part = 0.3;
                else if (bodypart == BODY_PART_LEGS) part = 1.0;
                z = z+offset-height+part;
            for(new i, m = GetMaxPlayers(); i < m; i++)
            {
                        if (!IsPlayerConnected(i)) continue;
                        if (playerid == i) continue;
                        if (IsPlayerInRangeOfPoint(i, 1.5, x, y, z-1.5)) return 1;
            }
        }
        return 0;
}
/*
                                                                                        ---[isPlayerAimingTargetBodyPart]---
                        »playerid: the player
                        »targetid: the target
                        »bodypart: the body part you want to check
                        *Return: 1 if true, 0 if false
                *-------------------------------------------------------------------*
                | Checks if the player is aiming at target\'s specific body part.        |
                *-------------------------------------------------------------------*
*/
stock IsPlayerAimingTargetBodyPart(playerid, targetid, bodypart)
{
        // Get the camera\'s positions
        new Float:x, Float:y, Float:z;
        new Float:vx, Float:vy, Float:vz;
        new Float:cx, Float:cy, Float:cz;
        GetPlayerCameraFrontVector(playerid, vx, vy, vz);
        GetPlayerCameraPos(playerid, cx, cy, cz);
        // Check if the player is aiming in a certain distance
        new Float:px, Float:py, Float:pz;
        GetPlayerPos(targetid, px, py, pz);
        new Float:dist = floatsqroot(((cx-px)*(cx-px)) + ((cy-py)*(cy-py)) + ((cz-pz)*(cz-pz)));
    x = vx*dist+cx;
    y = vy*dist+cy;
    z = vz*dist+cz;
    new Float:offset;
        switch (GetPlayerWeapon(playerid))
        {
            case 24, 29, 22, 23, 25, 26, 27, 28, 32: offset = 0.1122047500310059125919013005129;
            case 30, 31: offset = 0.07867820613690007867820613690008;
            case 33, 34: offset = 0.0;
        }
        new Float:height;
        if (z > cz) height = z-cz;
        else height = cz-z;
        offset *= dist;
        height /= dist;
        new Float:part;
        if (bodypart == BODY_PART_HEAD) part = -0.4;
        else if (bodypart == BODY_PART_TORSO) part = 0.3;
        else if (bodypart == BODY_PART_LEGS) part = 1.0;
        z = z+offset-height+part;
    if (IsPlayerInRangeOfPoint(targetid, 0.5, x, y, z-0.5)) return 1;
   
        return 0;
}

body inc
« Válasz #2 Dátum: 2016. Augusztus 27. - 12:22:37 »
0 Show voters
bodyparts.inc néven keress rá a neten

Nem elérhető #ωᴇʙsᴛᴇʀ

  • 425
  • Aki hisz az megbocsatast nyer .. Egy jo nap
    • Profil megtekintése
body inc
« Válasz #3 Dátum: 2016. Augusztus 27. - 12:26:27 »
0 Show voters

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal