forward TazeTimer(playerid);
public TazeTimer(playerid)
{
if(IsPlayerLoggedIn(playerid))
{
new string[128];
if (TazeTimeout[playerid] > 0)
{
format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Tazer effect fading in ~w~%d ~r~seconds", TazeTimeout[playerid]);
GameTextForPlayer(playerid, string,1500, 3);
TazeTimeout[playerid] -= 1;
}
if(TazeTimeout[playerid] <= 0)
{
KillTimer(TazeCountDown[playerid]);
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
TogglePlayerTazed(playerid, 0);
}
}
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
new suspect = playerid;
playerid = issuerid;
if(PlayerHasTaser[playerid] == 1)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
if(IsPlayerConnected(suspect))
{
if(IsPlayerInRangeOfPoint(suspect, 10.0, x, y, z) && weaponid == 23)
{
ClearAnimations(suspect);
ApplyAnimation(suspect, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
}
}
}
return 1;
}
|
You should post your solution in case others might face the same problem.
|