[Ajuda] Quero passa o anti-airbrak altomatico pra da Kick
#1

aJUDA AE PRECISO MUITO DISSO PRA PEGA RATOS VOADORES
PHP код:
#include <a_samp>
//Settings
#define UPDATE_COUNT 5
#define POSSIBLE_AIRBREAK_COUNT_CAR 9
#define POSSIBLE_AIRBREAK_COUNT_ONFOOT 7
//Settings end
new pupdates[MAX_PLAYERS],airbreakcount[MAX_PLAYERS],running=1;
public 
OnFilterScriptInit()
{
    new 
c;
    
c=POSSIBLE_AIRBREAK_COUNT_CAR;
    if(
7)
    {
        print(
"PERIGO: POSSIVEL_AIRBREAK_USANDO_CARRO й < 7, deve ser pelo menos >=7!!!");
        
running=0;
        print(
"Anti Airbreak estб agora desligado.");
    }
    
c=POSSIBLE_AIRBREAK_COUNT_ONFOOT;
    if(
5)
    {
        print(
"PERIGO: POSSIVEL_AIRBREAK_ANDANDO_APE й < 5, deve ser pelo menos >=5!!!");
        
running=0;
        print(
"Anti Airbreak estб agora desligado.");
    }
    return 
1;
}
public 
OnPlayerCommandText(playerid,cmdtext[])
{
    if(!
IsPlayerAdmin(playerid)) return 0;
    if(
strcmp(cmdtext"/toggleaairbreak"true) == 0)
    {
        switch(
running)
        {
             case 
0: {running=1SendClientMessage(playerid,0xFF0000FF,"Anti-Airbreak foi ligado!");}
            case 
1: {running=0SendClientMessage(playerid,0xFF0000FF,"Anti-Airbreak foi desligado!");}
        }
        return 
1;
    }
    
    new 
cmd[128];
    new 
idx;
    
cmd strtok(cmdtextidx);
    if(
strcmp(cmd"/pairbreakcount"true) == 0)
    {
        new 
tmp[128];
        
tmp=strtok(cmdtext,idx);
        if(!
strlen(tmp)) { SendClientMessage(playerid,0xFF0000FF,"Use: /pairbreakcount (id)"); return 1; }
        new 
id strval(tmp);
        new 
str[60],name[MAX_PLAYER_NAME];
        
GetPlayerName(id,name,MAX_PLAYER_NAME);
        
format(str,sizeof(str),"%s's atual airbreakcount й %d",name,airbreakcount[id]);
        
SendClientMessage(playerid,0xFF0000FF,str);
        return 
1;
    }
    
    return 
0;
}
strtok(const text[], &index)
{
    new 
length strlen(text);
    while ((
index length) && (text[index] <= ' '))
    {
        
index++;
    }
    new 
offset index;
    new 
result[20];
    while ((
index length) && (text[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {
        
result[index offset] = text[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result;
}
public 
OnPlayerUpdate(playerid)
{
    
// ANTIAIRBREAK
    
pupdates[playerid]++;
    if(
pupdates[playerid] > UPDATE_COUNT && running == 1)
    {
        
pupdates[playerid]=0;
        new 
check;
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsVehicleValid(GetPlayerVehicleID(playerid)))
        {
            new 
Float:vx,Float:vy,Float:vz;
            
GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
            if(
vx==0.0 && vy==0.0 && vz < -0.0032 && vz > -0.022)
            {
                if(
IsPlayerInWater(playerid)==0)
                {
                
check=1;
                }
                else
                {
                
check=3;
                }
            }
        }
        else
        {
            if(
GetPlayerState(playerid)==PLAYER_STATE_ONFOOT && GetPlayerSurfingVehicleID(playerid)==INVALID_VEHICLE_ID)
            {
                new 
Float:vx,Float:vy,Float:vz,Float:px,Float:py,Float:pz;
                
GetPlayerVelocity(playerid,vx,vy,vz);
                
pupdates[playerid]=0;
                new 
keys,ud,lr;
                
GetPlayerKeys(playerid,keys,ud,lr);
                if (
keys KEY_SPRINT)
                {
                    if(-
0.022 vz < -0.0040 && -0.235 vx 0.235 && -0.235 vy 0.235)
                    {
                        if(!
IsPlayerInRangeOfPoint(playerid,2.0,GetPVarFloat(playerid,"oposx"),GetPVarFloat(playerid,"oposy"),GetPVarFloat(playerid,"oposz")) || -0.5>(GetPVarFloat(playerid,"oposz")-pz)>-0.1 || 0.075>(GetPVarFloat(playerid,"oposz")-pz)>-0.075)
                          {
                            if(
IsPlayerInWater(playerid)==0)
                            {
                                
check=2;
                                if(
airbreakcount[playerid] > (POSSIBLE_AIRBREAK_COUNT_ONFOOT-2))
                                {
                                    
SetPlayerVelocity(playerid,0.3,0.3,0.3);
                                }
                            }
                            else
                            {
                                
check=3;
                            }
                        }
                        
SetPVarFloat(playerid,"oposx",px);
                        
SetPVarFloat(playerid,"oposy",py);
                        
SetPVarFloat(playerid,"oposz",pz);
                    }
                }
                else
                {
                    if(-
0.022 vz < -0.0040 && -0.121 vx 0.121 && -0.121 vy 0.121)
                    {
                        if(!
IsPlayerInRangeOfPoint(playerid,2.0,GetPVarFloat(playerid,"oposx"),GetPVarFloat(playerid,"oposy"),GetPVarFloat(playerid,"oposz")) || -0.5>(GetPVarFloat(playerid,"oposz")-pz)>-0.1 || 0.075>(GetPVarFloat(playerid,"oposz")-pz)>-0.075)
                          {
                            if(
IsPlayerInWater(playerid)==0)
                            {
                                
check=2;
                                if(
airbreakcount[playerid] > (POSSIBLE_AIRBREAK_COUNT_ONFOOT-2))
                                {
                                    
SetPlayerVelocity(playerid,0.3,0.3,0.3);
                                }
                            }
                            else
                            {
                                
check=3;
                            }
                        }
                        
SetPVarFloat(playerid,"oposx",px);
                        
SetPVarFloat(playerid,"oposy",py);
                        
SetPVarFloat(playerid,"oposz",pz);
                    }
                }
            }
        }
        if(
check 0)
        {
            if(
check 3)
            {
                new 
POSSIBLE_AIRBREAK_COUNT;
                switch(
check)
                 {
                     case 
1POSSIBLE_AIRBREAK_COUNT=POSSIBLE_AIRBREAK_COUNT_CAR;
                     case 
2POSSIBLE_AIRBREAK_COUNT=POSSIBLE_AIRBREAK_COUNT_ONFOOT;
                 }
                
airbreakcount[playerid]++;
                if(
airbreakcount[playerid] > POSSIBLE_AIRBREAK_COUNT)
                {
                        
airbreakcount[playerid]=0;
                         new 
ip[20],name[24];
                         
GetPlayerName(playerid,name,sizeof(name));
                         
GetPlayerIp(playerid,ip,sizeof(ip));
                         switch(
check)
                         {
                             case 
1:printf("Airbreak: %s(%s) foi banido. Reaзгo: Airbreak [CARRO] [by D0erf|er]",name,ip);
                             case 
2:printf("Airbreak: %s(%s) foi banido. Reaзгo: Airbreak [A PЙ] [by D0erf|er]",name,ip);
                         }
                        
Ban(playerid);
                }
            }
        }
        else
        {
             
airbreakcount[playerid]=0;
        }
    }
    return 
1;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    
airbreakcount[playerid]=0;
    return 
1;
}
stock IsVehicleValid(id)
{
    new 
type=GetVehicleModel(id);
    new 
blocked[]={ 548425417487488497563447469520 };
    for(new 
i;i<sizeof(blocked);i++)
    {
        if(
type == blocked[i])
        {
            return 
0;
        }
    }
    return 
1;
}
stock IsPlayerInArea(playeridFloat:max_xFloat:min_xFloat:max_yFloat:min_y)
{
    new 
Float:XFloat:YFloat:Z;
    
GetPlayerPos(playeridXYZ);
    if(
<= max_x && >= min_x && <= max_y && >= min_y) return 1;
    return 
0;
}
stock IsPlayerInWater(playerid)
{
    new 
Float:x,Float:y,Float:pz;
    
GetPlayerPos(playerid,x,y,pz);
    if (
     (
IsPlayerInArea(playerid2032.13711841.26561703.16531467.1099) && pz <= 9.0484//lv piratenschiff
      
|| (IsPlayerInArea(playerid2109.07252065.82321962.535510.8547) && pz <= 10.0792//lv visage
      
|| (IsPlayerInArea(playerid, -492.5810, -1424.71222836.82842001.8235) && pz <= 41.06//lv staucamm
      
|| (IsPlayerInArea(playerid, -2675.1492, -2762.1792, -413.3973, -514.3894) && pz <= 4.24//sf sьdwesten kleiner teich
      
|| (IsPlayerInArea(playerid, -453.9256, -825.7167, -1869.9600, -2072.8215) && pz <= 5.72//sf gammel teich
      
|| (IsPlayerInArea(playerid1281.02511202.2368, -2346.7451, -2414.4492) && pz <= 9.3145//ls neben dem airport
      
|| (IsPlayerInArea(playerid2012.61541928.9028, -1178.6207, -1221.4043) && pz <= 18.45//ls mitte teich
      
|| (IsPlayerInArea(playerid2326.48582295.7471, -1400.2797, -1431.1266) && pz <= 22.615//ls weiter sьdцstlich
      
|| (IsPlayerInArea(playerid2550.04542513.75881583.37511553.0753) && pz <= 9.4171//lv pool цstlich
      
|| (IsPlayerInArea(playerid1102.36341087.3705, -663.1653, -682.5446) && pz <= 112.45//ls pool nordwestlich
      
|| (IsPlayerInArea(playerid1287.79061270.4369, -801.3882, -810.0527) && pz <= 87.123//pool bei maddog's haus oben
      
|| (pz 1.5)
    )
    {
        return 
1;
    }
    return 
0;

Reply
#2

Troca Ban por Kick lol
Reply
#3

kkkk
Reply
#4

aff vc nao intedeu eu quero tirar o comando e colocar um detector altomatico q de kick sozinho sem usar comandos como esta ai nos codigo q mandei
Reply
#5

mano aconselho isso!

https://sampforum.blast.hk/showthread.php?tid=386231
Reply
#6

running=1 em onfilterscriptinit.
Reply
#7

ae vlw consegui aqui sky
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)