[FilterScript] Antibug Collection
#7

С лютой долей испралений имеем:
PHP Code:
#include <a_samp>
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
    
new 
BugTickCountOld[MAX_PLAYERS],BugTickCountNew[MAX_PLAYERS],boolPressedFire[MAX_PLAYERS];
public 
OnFilterScriptInit()
{
    print(
"Antibug Collection 0.1 by Psycho loaded!");
    for(new 
0MAX_PLAYERSi++)
    {
        
PressedFire[i] = false;
        
BugTickCountOld[i] = 0;
        
BugTickCountNew[i] = 0;
    }
    return 
1;
}
public 
OnFilterScriptExit()
{
    print(
"Antibug Collection 0.1 Psycho unloaded!");
    return 
1;
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
wid GetPlayerWeapon(playerid);
    
BugTickCountNew[playerid] = GetTickCount();
    new 
ticks BugTickCountNew[playerid] - BugTickCountOld[playerid];
    if(
PressedFire[playerid] && PRESSED(KEY_CROUCH))
    {
        if(
22 <= wid <= 38)
        {
            if(
10 ticks 1500  && GetPlayerSpeed(playerid) > 0)
            {
                new 
string[128];
                
GetPlayerName(playeridstringMAX_PLAYER_NAME);
                
format(string,128,"%s (id: %d) èñïîëüçîâàë áàã-ïðèñÿäêó.",string,playerid);
                
SendClientMessage(playerid,0xffffffff,string);
                
SetPlayerVelocity(playerid,0.0,0.0,7.0);
            }
            
PressedFire[playerid] = false;
        }
    }
    if (
PRESSED(KEY_FIRE))
    {
        
PressedFire[playerid] = true;
        
BugTickCountOld[playerid] = GetTickCount();
    }
    return 
1;
}
stock GetPlayerSpeed(playerid)
{
    new 
Float:ST[3];
    if(
IsPlayerInAnyVehicle(playerid))GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    else 
GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    
ST[0] = floatsqroot(floatpower(ST[0], 2.0) + floatpower(ST[1], 2.0) + floatpower(ST[2], 2.0));
    return 
floatround(ST[3])*100;

Reply


Messages In This Thread
Antibug Collection - by ^Woozie^ - 12.08.2010, 09:01
Re: [FS] Antibug Collection - by Stepashka - 12.08.2010, 09:04
Re: [FS] Antibug Collection - by ^Woozie^ - 12.08.2010, 09:07
Re: [FS] Antibug Collection - by MX_Master - 12.08.2010, 09:09
Re: [FS] Antibug Collection - by ^Woozie^ - 12.08.2010, 09:11
Re: [FS] Antibug Collection - by Stepashka - 12.08.2010, 09:23
Re: [FS] Antibug Collection - by Stepashka - 12.08.2010, 09:25
Re: [FS] Antibug Collection - by ZiGGi - 12.08.2010, 10:12
Re: [FS] Antibug Collection - by MX_Master - 12.08.2010, 13:53
Re: [FS] Antibug Collection - by ^Woozie^ - 12.08.2010, 14:14

Forum Jump:


Users browsing this thread: 1 Guest(s)