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.){ 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;}
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);}
C:\\Users\\user\\Desktop\\afterlife.pwn(50173) : error 017: undefined symbol \"bodypart\"C:\\Users\\user\\Desktop\\afterlife.pwn(50178) : error 017: undefined symbol \"bodypart\"
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\"
C:\\Users\\user\\Desktop\\afterlife.pwn(50167) : error 029: invalid expression, assumed zeroC:\\Users\\user\\Desktop\\afterlife.pwn(50167) : error 017: undefined symbol \"bodypart\"C:\\Users\\user\\Desktop\\afterlife.pwn(50167) : error 029: invalid expression, assumed zeroC:\\Users\\user\\Desktop\\afterlife.pwn(50167) : fatal error 107: too many error messages on one line
if(,bodypart == OPH_HEAD)
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;}
C:\\Users\\user\\Desktop\\afterlife.pwn(50167) : warning 217: loose indentationC:\\Users\\user\\Desktop\\afterlife.pwn(50167) : error 029: invalid expression, assumed zeroC:\\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 codeC:\\Users\\user\\Desktop\\afterlife.pwn(50183) : warning 217: loose indentationPawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
#include <a_samp>#define TESTRESZ_FEJ 0#define TESTRESZ_TEST 1#define TESTRESZ_LAB 2#define MAX_DISTANCE_UNIT 200stock 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.) 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);