SA-MP Forums Archive
Help with func - 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: Help with func (/showthread.php?tid=624919)



Help with func - Micko123 - 25.12.2016

I found this
PHP код:
public FallingChecker() 

   new 
Float:x,Float:y,Float:z,Float:d
   for(new 
=0i<MAX_PLAYERSi++) 
   { 
     if(
IsPlayerConnected(i)) 
     { 
        
GetPlayerPos(i,x,y,z); 
        
floatsqroot((x-LastX[i] * x-LastX[i]) + (y-LastY[i] * y-LastY[i])); 
        if(
10 && (LastZ[i] - z) > 5
        { 
          
OnPlayerFall(i); 
        } 
        
LastX[i] = x
        
LastY[i] = y
        
LastZ[i] = z
     } 
   } 
   return 
1

public 
OnPlayerFall(playerid

    
SendClientMessage(playerid,0x000000FF,"You are falling!"); 
    return 
1

And it is working as supposed to..
But any ideas how ca I make implement this in my anti speed hack. So if player is falling it won't detect him as cheater but he will get deteted as falling.. Any ideas?


Re: Help with func - lackmail - 25.12.2016

use boolean under onplayerfall set variable to true and when detecting check if the variable is true or false