frog163

Anti-antifreeze

Nov 26th, 2012
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Anti-anti-freeze
  2. //frog163 © 2012
  3. #include a_samp
  4. new Float:toogle_pos[MAX_PLAYERS][3], toogle_ticks;
  5. new bool:IsTogglePlayerControllable[MAX_PLAYERS char];
  6. #define IsTogglePlayerControllable(%1)  IsTogglePlayerControllable{%1}
  7. public OnPlayerUpdate(playerid){
  8.     if(toogle_ticks < GetTickCount()){
  9.         if(!IsTogglePlayerControllable(playerid))//если заморожен
  10.             if(!IsPlayerInRangeOfPoint(playerid, 1.0, toogle_pos[playerid][0],toogle_pos[playerid][1],toogle_pos[playerid][2]))//если двигался
  11.                 SetPlayerPos(playerid, toogle_pos[playerid][0],toogle_pos[playerid][1],toogle_pos[playerid][2]);//телепорт игрока на те координаты где его зафризило
  12.         toogle_ticks = GetTickCount()+500;
  13.     }
  14.     return true;
  15. }
  16. stock MyTogglePlayerControllable(playerid, bool:toggle){
  17.     if(!toggle)//Если замораживаем
  18.         GetPlayerPos(playerid, toogle_pos[playerid][0],toogle_pos[playerid][1],toogle_pos[playerid][2]);//Узнаем координаты
  19.     TogglePlayerControllable(playerid, toggle);
  20.     IsTogglePlayerControllable(playerid) = toggle;
  21.     return true;
  22. }
  23. #define TogglePlayerControllable MyTogglePlayerControllable
RAW Paste Data Copied