SA-MP Forums Archive
swiming - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: swiming (/showthread.php?tid=448733)



swiming - aboa - 05.07.2013

How can I make that if player swim for 15 mins will get auto-kick and even swiming regular or with sprint.


Re: swiming - DaRk_RaiN - 05.07.2013

Set a timer that checks if the player is in the water/swimming and kick him, use the stock below.
pawn Код:
//This stock isn't mine, credits to who ever made it.
stock IsPlayerInWater( playerid )
{
    new anim = GetPlayerAnimationIndex( playerid );
    if (((anim >=  1538) && (anim <= 1542)) || (anim == 1544) || (anim == 1250) || (anim == 1062)) return 1;
    return 0;
}



Re: swiming - Akira297 - 05.07.2013

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
Set a timer that checks if the player is in the water/swimming and kick him, use the stock below.
pawn Код:
//This stock isn't mine, credits to who ever made it.
stock IsPlayerInWater( playerid )
{
    new anim = GetPlayerAnimationIndex( playerid );
    if (((anim >=  1538) && (anim <= 1542)) || (anim == 1544) || (anim == 1250) || (anim == 1062)) return 1;
    return 0;
}
That could be a good function for anti-airbreaking hacks.. If I am not mistaken?


Re: swiming - MP2 - 05.07.2013

Quote:
Originally Posted by Akira297
Посмотреть сообщение
That could be a good function for anti-airbreaking hacks.. If I am not mistaken?
Yes. If they're above Z height 0 (water height all over SA*) and they're playing a swimming animation, they're cheating.

* One exception is North of sherman dam, which is higher. Also, it's possible for a player to go lower than 0 (underwater and the quarry) so you'd have to detect whether they're underwater or not.


Re: swiming - DaRk_RaiN - 05.07.2013

Quote:
Originally Posted by Akira297
Посмотреть сообщение
That could be a good function for anti-airbreaking hacks.. If I am not mistaken?
It is, that + checking for the player velocity will give an accurate result.