Szerző Téma: Fejbe halál lábba anim  (Megtekintve 1778 alkalommal)

Fejbe halál lábba anim
« Dátum: 2012. Június 12. - 15:34:35 »
0 Show voters
Sziasztok.
Kéne nekem egy olyan script amivel ha valakit fejbe lövök akkor meghal de ha lábba akkor animba esik.
Van ilyen???

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Fejbe halál lábba anim
« Válasz #1 Dátum: 2012. Június 12. - 15:39:13 »
0 Show voters
Úgy tudom a fejét nem lehet lekérni.

Fejbe halál lábba anim
« Válasz #2 Dátum: 2012. Június 12. - 15:40:42 »
0 Show voters
és a lábát?

Nem elérhető Erik3333

  • 945
  • SMF | phpBB | TS3 | PHP | HTML | CSS | JS | PAWN | JAVA
    • Profil megtekintése
Fejbe halál lábba anim
« Válasz #3 Dátum: 2012. Június 12. - 15:43:15 »
0 Show voters
forward IsPlayerAimingTargetBodyPart(playerid, targetid, bodypart);
public IsPlayerAimingTargetBodyPart(playerid, targetid, bodypart)
{
new Float:x, Float:y, Float:z, Float:a;
new Float:vx, Float:vy, Float:vz;
new Float:cx, Float:cy, Float:cz;
new Float:offset;
new Float:radius;
GetPlayerCameraFrontVector(playerid, vx, vy, vz);
GetPlayerCameraPos(playerid, cx, cy, cz);
GetPlayerFacingAngle(playerid, a);
for(new Float:d; d < MAX_DISTANCE_UNIT; d += 0.5)
{
switch (GetPlayerWeapon(playerid))
{
    case 24, 29, 22, 23, 25, 26, 27, 28, 32: offset = 0.11;
    case 30, 31: offset = 0.07;
    case 33, 34: offset = 0.0;
}
    switch (GetPlayerWeapon(playerid))
    {
        case 22, 26, 28, 32:
        {
       x = vx*d+cx;
       y = vy*d+cy;
        }
        default:
        {
            x = cx + (d * floatsin(-a, degrees));
          y = cy + (d * floatcos(-a, degrees));
        }
    }
    z = (vz+offset)*d+cz;
    switch (bodypart)
    {
        case TESTRESZ_FEJ: z -= 0.0, radius = 0.3;
        case TESTRESZ_TEST: z += 0.6, radius = 0.5;
        case TESTRESZ_LAB: z += 1.2, radius = 0.4;
    }
if (GetPlayerSpecialAction(targetid) == SPECIAL_ACTION_DUCK)
{
   if (IsPlayerInRangeOfPoint(targetid, radius+0.2, x, y, z+1.2-1.3-(bodypart==TESTRESZ_TEST?0.42:0.0)))
   {
      return 1;
   }
}
else if (IsPlayerInRangeOfPoint(targetid, radius, x, y, z-0.8))
{
   return 1;
}
}
return 0;
}
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
if(IsPlayerAimingTargetBodyPart(playerid, damagedid, TESTRESZ_LAB))
{
    //MIT CSINÁLJON, HA LÁBONLÖVIK
}
else if(IsPlayerAimingTargetBodyPart(playerid, damagedid, TESTRESZ_FEJ))
{
    //MIT CSINÁLJNON, HA FEJBELÖVIK
}
return 1;
}

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Fejbe halál lábba anim
« Válasz #4 Dátum: 2012. Június 12. - 15:48:35 »
0 Show voters
Ez a láb:
 

if(bodypart == OPH_FOOT)
{
SendClientMessage(playerid, -1, \"Lábon lõttek!\");
}

 
Fej:
 

if(bodypart == OPH_HEAD)
{
SendClientMessage(playerid, -1, \"Fejbe Löttek! Meghaltál\");
SetPlayerHealth(playerid,0);
}
« Utoljára szerkesztve: 2012. Június 12. - 15:51:47 írta ZyZu »

Fejbe halál lábba anim
« Válasz #5 Dátum: 2012. Június 12. - 15:50:47 »
0 Show voters
Warningos:
 
C:\\Users\\user\\Desktop\\afterlife.pwn(50173) : error 017: undefined symbol \"bodypart\"
C:\\Users\\user\\Desktop\\afterlife.pwn(50178) : error 017: undefined symbol \"bodypart\"

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Fejbe halál lábba anim
« Válasz #6 Dátum: 2012. Június 12. - 15:55:06 »
0 Show voters
Idézetet írta: Devil112 date=1339509047\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"22755\" data-ipsquote-contentclass=\"forums_Topic
Warningos:
 
C:\\Users\\user\\Desktop\\afterlife.pwn(50173) : error 017: undefined symbol \"bodypart\"
C:\\Users\\user\\Desktop\\afterlife.pwn(50178) : error 017: undefined symbol \"bodypart\"

 

Ahova rakod pl írd oda: public OnPlayerSpawn(bodypart)
Ez csak egy példa volt ahova írod oda ragd a public -hoz, hogy bodypart!

Fejbe halál lábba anim
« Válasz #7 Dátum: 2012. Június 12. - 15:57:27 »
0 Show voters
nem értem

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Fejbe halál lábba anim
« Válasz #8 Dátum: 2012. Június 12. - 16:02:08 »
0 Show voters
Ahova be írod a kerek zárójelbe írd be így vesszõvel!!
,bodypart
Így be írod ahova szeretnéd tenni és 100% menni fog! A kerek zárójelbe!

Fejbe halál lábba anim
« Válasz #9 Dátum: 2012. Június 12. - 16:05:28 »
0 Show voters
Most ezt adja ki
 

C:\\Users\\user\\Desktop\\afterlife.pwn(50167) : error 029: invalid expression, assumed zero
C:\\Users\\user\\Desktop\\afterlife.pwn(50167) : error 017: undefined symbol \"bodypart\"
C:\\Users\\user\\Desktop\\afterlife.pwn(50167) : error 029: invalid expression, assumed zero
C:\\Users\\user\\Desktop\\afterlife.pwn(50167) : fatal error 107: too many error messages on one line

 

    if(,bodypart == OPH_HEAD) 

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Fejbe halál lábba anim
« Válasz #10 Dátum: 2012. Június 12. - 16:11:55 »
0 Show voters

public OnPlayerHit(playerid, hiterid, bodypart, weaponid, Float:distance)
{
if(bodypart == OPH_FOOT)
{
SendClientMessage(playerid, -1, \"Lábon lõttek!\");
}
if(bodypart == OPH_HEAD)
{
SendClientMessage(playerid, -1, \"Fejbe Löttek! Meghaltál\");
SetPlayerHealth(playerid,0);
}
return 1;
}

 
Tessék így masold be a modba bár hova!

Fejbe halál lábba anim
« Válasz #11 Dátum: 2012. Június 12. - 16:18:24 »
0 Show voters
Megin
 

C:\\Users\\user\\Desktop\\afterlife.pwn(50167) : warning 217: loose indentation
C:\\Users\\user\\Desktop\\afterlife.pwn(50167) : error 029: invalid expression, assumed zero
C:\\Users\\user\\Desktop\\afterlife.pwn(50167) : error 017: undefined symbol \"OnPlayerHit\"
C:\\Users\\user\\Desktop\\afterlife.pwn(50169) : error 017: undefined symbol \"bodypart\"
C:\\Users\\user\\Desktop\\afterlife.pwn(50174) : error 017: undefined symbol \"bodypart\"
C:\\Users\\user\\Desktop\\afterlife.pwn(50183) : warning 225: unreachable code
C:\\Users\\user\\Desktop\\afterlife.pwn(50183) : warning 217: loose indentation
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Fejbe halál lábba anim
« Válasz #12 Dátum: 2012. Június 12. - 16:20:05 »
0 Show voters

Fejbe halál lábba anim
« Válasz #13 Dátum: 2012. Június 12. - 18:38:21 »
0 Show voters
Az itt adott válaszok alapján csináltam, fogalmam sincs, hogy mûködik-e
 
#include <a_samp>
#define TESTRESZ_FEJ    0
#define TESTRESZ_TEST   1
#define TESTRESZ_LAB    2
#define MAX_DISTANCE_UNIT 200
stock IsPlayerAimingTargetBodyPart(playerid, targetid, bodypart) {
new Float:x, Float:y, Float:z, Float:a,
Float:vx, Float:vy, Float:vz,
Float:cx, Float:cy, Float:cz;
new Float:offset, Float:radius;
GetPlayerCameraFrontVector(playerid, vx, vy, vz);
GetPlayerCameraPos(playerid, cx, cy, cz);
GetPlayerFacingAngle(playerid, a);
for(new Float:d; d < MAX_DISTANCE_UNIT; d += 0.5) {
switch (GetPlayerWeapon(playerid)) {
    case 24, 29, 22, 23, 25, 26, 27, 28, 32: offset = 0.11;
    case 30, 31: offset = 0.07;
    case 33, 34: offset = 0.0;
}
    switch (GetPlayerWeapon(playerid)) {
        case 22, 26, 28, 32: {
       x = vx*d+cx;
       y = vy*d+cy;
        }
        default: {
            x = cx + (d * floatsin(-a, degrees));
          y = cy + (d * floatcos(-a, degrees));
        }
    }
    z = (vz+offset)*d+cz;
    switch (bodypart) {
        case TESTRESZ_FEJ: z -= 0.0, radius = 0.3;
        case TESTRESZ_TEST: z += 0.6, radius = 0.5;
        case TESTRESZ_LAB: z += 1.2, radius = 0.4;
    }
if (GetPlayerSpecialAction(targetid) == SPECIAL_ACTION_DUCK) {
   if (IsPlayerInRangeOfPoint(targetid, radius+0.2, x, y, z+1.2-1.3-(bodypart==TESTRESZ_TEST?0.42:0.0))) return 1;
}
else if (IsPlayerInRangeOfPoint(targetid, radius, x, y, z-0.8)) return 1;
}
return 0;
}
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid) {
if(IsPlayerAimingTargetBodyPart(playerid, damagedid, TESTRESZ_FEJ)) {
    new Float:health;
    GetPlayerHealth(damagedid, health);
    if(health < 20) {
        SetPlayerHealth(damagedid, 0.0);
        ApplyAnimation(damagedid,\"PED\",\"KO_skid_front\",4.1,0,1,1,1,1);
}
}
return 1;
}
public OnPlayerSpawn(playerid) ClearAnimations(playerid);
« Utoljára szerkesztve: 2012. Június 12. - 18:39:22 írta TengeriMalac »

Fejbe halál lábba anim
« Válasz #14 Dátum: 2012. Június 12. - 19:20:17 »
0 Show voters
csak nekem warningos? :D xd :S

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal