31.01.2015, 20:30
HOW TO ADD HERE HEADSHOT ONLY IN HEAD
Код:
#include <a_samp> #include <Shooter> #pragma tabsize 0 #define COLOR_RED 0xFC3535FF #define SERVER_MAX_PLAYERS 500 public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost) { if (Shooter != INVALID_PLAYER_ID) { if (GetPlayerTeam(Target) == GetPlayerTeam(Shooter)) // check if the target is from the same team as the shooter. { new Float:hp; GetPlayerHealth(Target, hp); SetPlayerHealth(Target, hp + HealthLost); } } if ( Shooter != INVALID_PLAYER_ID ) { if (GetPlayerTeam(Target) != GetPlayerTeam(Shooter)) // check if the target is not from the same team as the shooter. { if(GetPlayerWeapon(Shooter) == 33) { SetPlayerHealth(Target, 0); GameTextForPlayer(Target, "~r~Head Shot!", 3000, 3); } if(GetPlayerWeapon(Shooter) == 34) { SetPlayerHealth(Target, 0); GameTextForPlayer(Target, "~r~Head Shot!", 3000, 3); } } } return 1; } public OnPlayerDeath( playerid, killerid, reason ) { if( killerid != INVALID_PLAYER_ID ) // if killer is valid player { TogglePlayerSpectating( playerid, 1 ); // toggle the spectate to enabled for playerid PlayerSpectatePlayer( playerid, killerid ); // spectate the killer SetTimerEx( "OnPlayerStopSpectate", 5000, false, "i", playerid ); // set a timer that in 5 seconds it will stop spectating } return 1; }