SA-MP Forums Archive
Anti Godmode - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti Godmode (/showthread.php?tid=245981)



Anti Godmode - iToast - 02.04.2011

i have a idea for one but how do we know if a player is AFK?!


Re: Anti Godmode - -Rebel Son- - 02.04.2011

Get the Include that detects it. It's in the include section.


Re: Anti Godmode - Mean - 02.04.2011

Set a player Z pos for +5. And if he doesn't move, he is afk, if he does move, he isn't AFK.
pawn Код:
new Float:pos[ 2 ]; GetPlayerPos( playerid, pos[ 0 ], pos[ 1 ], pos[ 2 ] );
SetPlayerPos( playerid, pos[ 0 ], pos[ 1 ], pos[ 2 ] + 5 );



Re: Anti Godmode - -Rebel Son- - 02.04.2011

Not to hijack, but thats a pretty neet trick mean.


Re: Anti Godmode - admantis - 02.04.2011

Another technique is to set a PVar to 10 on OnPlayerUpdate.
Then on a one second timer lower that variable by -1, when the variable reaches 0 it means he's been AFK ( Pause ) for 10 seconds.


Re: Anti Godmode - iToast - 02.04.2011

Quote:
Originally Posted by Mean
Посмотреть сообщение
Set a player Z pos for +5. And if he doesn't move, he is afk, if he does move, he isn't AFK.
pawn Код:
new Float:pos[ 2 ]; GetPlayerPos( playerid, pos[ 0 ], pos[ 1 ], pos[ 2 ] );
SetPlayerPos( playerid, pos[ 0 ], pos[ 1 ], pos[ 2 ] + 5 );
Perfect!