Code
#include <a_samp>
forward TazerTime(playerid);
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
#pragma unused issuerid
#pragma unused amount
if(IsACop(playerid)) { if(weaponid == 3) { TogglePlayerControllable(playerid, 0); SetTimer("TazerTime",5000,0); } }
return 1;
}
public TazerTime(playerid) return TogglePlayerControllable(playerid, 1);
если у вас нет проверки IsACop:
Code
PHP код:
forward IsACop(playerid);
public IsACop(playerid)
{
if(IsPlayerConnected(playerid))
{
new leader = PlayerInfo[playerid][pLeader];
new member = PlayerInfo[playerid][pMember];
if(member==1 || member==2 || member==3)
{ return 1; }
else if(leader==1 || leader==2 || leader==3)
{ return 1; }
}
return 0;