Tazing timer
#1

Hello,

I just made a tazer for cops using a include.
I made this script:

Код:
public OnPlayerShootPlayer(shooter,target,Float:damage)
{
    if(GetPlayerWeapon(shooter) == 23)
    {
  		if(IsACop[shooter] == 1 && OnDuty[shooter] == 1)
		{
		    if(IsACop[target] == 1 && OnDuty[target] == 1)
		    {
		        SendClientMessage(shooter, COLOR_GREY, "  You can't taze cops.");
		        return 1;
			}
        	new otherplayer = target;
        	new Float:Pos[3];
        	GetPlayerPos(otherplayer, Pos[0], Pos[1], Pos[2]);
        	if(!IsPlayerConnected(otherplayer)) return SendClientMessage(shooter,COLOR_RED,"  Bad Playerid.");

			new string[256], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
			GetPlayerName(shooter, name, sizeof(name));
			GetPlayerName(otherplayer, name2, sizeof(name2));

			if(IsPlayerInRangeOfPoint(shooter, 10, Pos[0], Pos[1], Pos[2]))
   			{
    			format(string, sizeof(string), "* You were Tazed by %s.", name);
				SendClientMessage(otherplayer, COLOR_WHITE, string);
				format(string, sizeof(string), "* You Tazed %s.", name2);
				SendClientMessage(shooter, COLOR_WHITE, string);
				format(string, sizeof(string), "* %s shoots with his Tazer at %s and tazed him.", name ,name2);
				ProxDetector(30.0, shooter, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				GameTextForPlayer(otherplayer, "~r~Tazed", 2500, 3);
				TogglePlayerControllable(otherplayer, 0);
				LoopingAnim(otherplayer, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
			}
			else
			{
			    SendClientMessage(shooter, COLOR_YELLOW, "  The player you want to taze is too far away.");
			}
		}
		else
		{
		    SendClientMessage(shooter, COLOR_GREY, "  You must be a LEO 'On Duty' to taze someone.");
  		}
  		return 1;
    }
    return 1;
}
So what the problem is, I can't really make a timer to stop the
tazer effect on the target. I don't exactly know how to do that.

Can someone give me tips?

Thanks!
Reply


Messages In This Thread
Tazing timer - by Ihsan-Cingisiz - 17.03.2011, 14:48
Re: Tazing timer - by Stigg - 17.03.2011, 14:51
Re: Tazing timer - by Ihsan-Cingisiz - 17.03.2011, 20:34
Re: Tazing timer - by maramizo - 17.03.2011, 21:01
Re: Tazing timer - by Marricio - 17.03.2011, 21:02
Re: Tazing timer - by maramizo - 17.03.2011, 21:07
Re: Tazing timer - by Marricio - 17.03.2011, 21:11
Re: Tazing timer - by maramizo - 17.03.2011, 21:12
Re: Tazing timer - by Ihsan-Cingisiz - 18.03.2011, 06:44

Forum Jump:


Users browsing this thread: 1 Guest(s)