13.10.2013, 00:50
(
Последний раз редактировалось DavidLuango; 14.10.2013 в 04:28.
)
resolved!
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
I have another way to do it which is completely different method in fact you wouldn't need any commands but would have to accept a limitations. Anyways I've done a lot of work lately using some simple collision techniques. The only problem is it's possible to shoot through objects or walls but I would think you'd have to get pretty lucky to abuse it. Anyways with that said you could use a melee weapon as the taser and some other stuff just a suggestion. Otherwise OnPlayerTakeDamage() or OnPlayerGiveDamage() will work if you want to take that route.
|
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(weaponid == 23) //silenced pistol
{
if(IsCop[issuerid] == 1]) //if the shooter is cop
{
new string[128], pName[MAX_PLAYERS_NAME];
GetPlayerName(issuerid, pName, sizeof(pName);
format(string, sizeof(string), "You've been tazed by %s and you are unable to move", pName);
SendCliendMessage(playerid, -1, string); //lettin him know who tazed him
TogglePlayerControllable(playerid, 0); //freeze player
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 20000, 0); //we set the animation for 20 seconds
SetTimerEx("Unfreeze", 20000, false, "i", playerid); //timer to unfreeze player in 20 seconds
}
}
return 1;
}
forward Unfreeze(playerid);
public Unfreeze(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
}
pawn Код:
|