04.08.2013, 02:20
PHP код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
new string[128];
if(GetPlayerWeapon(Shooter) == 34 && PlayerInfo[Shooter][pScope] && Hitman[Shooter] == Target)
{
SetPlayerHealth(Target, 0);
if(Hitman[Shooter] == Target)
{
format(string, sizeof(string), " You have been critically injured by a hitman and lost $%d, the contrat on your head was cleared.", PlayerInfo[Target][pContract]/2);
SendClientMessage(Target, COLOR_YELLOW, string);
format(string, sizeof(string), "HitmanWarn: %s has fulfilled the contract on %s's head and collected $%d.", RPN(Shooter), RPN(Target), PlayerInfo[Target][pContract]/2);
SendHitmanMessage(COLOR_YELLOW, string);
GiveDodMoney(Target, -PlayerInfo[Target][pContract]/2);
GiveDodMoney(Shooter, PlayerInfo[Target][pContract]/2);
PlayerInfo[Target][pContract] = 0;
format(PlayerInfo[Target][pContract], 32, "");
Hitman[Shooter] = -1;
PlayerInfo[Shooter][pCSuccess] ++;
}
PlayerInfo[Shooter][pScope] --;
}
if(!IsACop(Shooter) || !IsNG(Shooter) || !IsFBI(Shooter))
{
if(Tazer[Shooter])
{
if(GetPlayerWeapon(Shooter) == 23)
{
if(!IsPlayerTazed(Target) && !IsPlayerCuffed(Target) && !IsPlayerTied(Target))
{
new Float:HP, Float:Armor;
GetPlayerHealth(Target, HP);
GetPlayerArmour(Target, Armor);
SetPlayerHealth(Target, HealthLost+HP);
SetPlayerArmour(Target, ArmourLost+Armor);
if(!IsPlayerNearPlayer(Shooter, Target, 15)) return SendClientMessage(Shooter, COLOR_GREY, "You are too far away from that player.");
// Got Tazed
format(string, sizeof(string), "* %s aims his tazer on %s and tazes him.", RPN(Shooter), RPN(Target));
SendNearbyMessage(Shooter, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(Target, "~r~Tazed", 3500, 3);
TogglePlayerControllable(Target, 0);
// Tazed Detecting
TogglePlayerTazed(Target, 1);
// Tazer Timeout
TazeTimeout[Target] = 11;
TazeCountDown[Target] = SetTimerEx("TazeTimer", 1000, true, "d", Target);
}
}
}
}
return 1;
}