It is something like that in client_main.fos
if(message=="~sf")
{
RunServerScriptUnsafe("unsafe@unsafe_sleep", 1, 0, 0, "", null);
return false;
}
if(message=="~sb")
{
RunServerScriptUnsafe("unsafe@unsafe_sleep", 0, 0, 0, "", null);
return false;
}
and this in some unsafe.fos
void unsafe_sleep(Critter& player, int param0, int param1, int param2, string@ param3, int[]@ param4)
{
if(!valid(player)) return;
if (!player.IsDead() && !player.IsKnockout() && player.GetTimeEvents(CTE_SLEEP, null, null, null)==0)
{
player.StatBase[ST_CURRENT_AP]=-100000;
player.ToKnockout(KNOCKOUT_ANIM2_DEFAULT((param0==0)), 5, player.HexX, player.HexY);
player.Say(SAY_NETMSG, "You fall.");
player.AddTimeEvent("cte_sleep", 0, CTE_SLEEP, 0);
return;
}
else if (!player.IsDead() && player.IsKnockout() && player.GetTimeEvents(CTE_SLEEP, null, null, null)!=0)
{
player.StatBase[ST_CURRENT_AP]=0;
player.EraseTimeEvents(CTE_WARNING);
player.Say(SAY_NETMSG, "You rise.");
return;
}
}
uint cte_sleep(Critter& player, int identifier, uint& rate)
{
if(player.StatBase[ST_CURRENT_AP]>=-50000) player.StatBase[ST_CURRENT_AP]=-100000;
return 100;
}
I made it for my RP russian server and so far it works fine. But we dont suffer from hackers or something like that, so i dont know if using unsafe scripts is much more less preferable for this server.
So for non-scripters:
~sf -drop you to ground in continious knockdown face down
~sb -same, but face up