28.07.2011, 01:53
Here is what I have:
I get 0 errors... But in game when a player shoots another player with a deagle, nothing happens...Why is that?
pawn Код:
forward DeagleShot(Shooter, Target);
forward TazerCharge(Shooter);
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
if(GetPlayerWeapon(Shooter) == 24 && PlayerInfo[Shooter][pGun02] == 24)
{
SetTimerEx("DeagleShot", 5000, 0, "ii", Shooter, Target);
ApplyAnimation(Target, "ped", "WALK_fatold", 4.0, 1, 0, 0, 0, 0);
}
else if(PlayerInfo[Shooter][pFaction] == 1 && CopDuty[Shooter] == 1 && TazerCharged[Shooter] == 0)
{
if(GetPlayerWeapon(Shooter) == 23 && PlayerInfo[Shooter][pGun02] == 23 && Tazer[Shooter] == 1)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(Target, X,Y,Z);
if(IsPlayerInRangeOfPoint(Shooter, 15.0, X,Y,Z))
{
ApplyAnimation(Target, "ped", "FALL_collapse", 4.0, 1, 0, 0, 0, 0);
SetPlayerHealth(Target, 50);
TazerCharged[Shooter] = 1;
SetTimerEx("TazerCharge", 10000, 0, "i", Shooter);
SendClientMessage(Shooter, COLOR_GREEN, "You shoot the criminal with your tazer and it begins to recharge!");
}
}
}
return 1;
}
public TazerCharge(Shooter)
{
TazerCharged[Shooter] = 0;
SendClientMessage(Shooter, COLOR_GREEN, "You tazer has fully recharged!");
return 1;
}
public DeagleShot(Shooter, Target)
{
ApplyAnimation(Target, "ped", "FALL_collapse", 4.0, 1, 0, 0, 0, 0);
SendClientMessage(Target, COLOR_RED, "You fall unconsious because of blood lose");
SendClientMessage(Shooter, COLOR_RED, "You notice the target fell unconsious because of blood lose");
return 1;
}