Raised This Month: $ Target: $400
 0% 

Detect player moving


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-30-2011 , 15:03   Re: Detect player moving
Reply With Quote #4

Best efficient way I could think of.
Code:
#include <fun>   #define MOVEMENT_CHECK_INTERVAL 5.0   new bool:IsMoving[33];   public plugin_init()         set_task(MOVEMENT_CHECK_INTERVAL, "TaskCheckIfMoved", _, _, _, "b");   public TaskCheckIfMoved() {         static oldOrigin[33][3];         new players[32];         new num;           get_players(players, num, "a");           for (new i, id, newOrigin[3]; i < num; i++)         {                 id = players[i];                   get_user_origin(id, newOrigin);                   IsMoving[id] = bool:(newOrigin[0] != oldOrigin[id][0] || newOrigin[1] != oldOrigin[id][1]);         } }
__________________

Last edited by hleV; 04-30-2011 at 15:06.
hleV is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode