[Ajuda] C-BUG
#1

Eu tenho este Anti C-BUG, mas ele nгo estб funcionando. Serб mal configurado?
Agradeзo desde jб toda ajuda <3




Код:
	//if ((newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH))
	if ((newkeys & KEY_FIRE) && (newkeys & KEY_CROUCH))
	{
	    // Anti C-BUG
		if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
		{
			if(GetPlayerWeapon(playerid) == 24)
			if(GetPlayerWeapon(playerid) == 25)
			if(GetPlayerWeapon(playerid) == 27)
			{
			    //new Animacionn[32], Libreriaa[32];
			    //GetAnimationName(GetPlayerAnimationIndex(playerid), Libreriaa, sizeof(Libreriaa), Animacionn, sizeof(Animacionn));
			    //if(strcmp(Libreriaa,"PED") == 0 && strcmp(Animacionn,"GUN_STAND") == 0)
				//{
    			    if(VariableCaido[playerid] == 0)
					{
						SetPlayerArmedWeapon(playerid, 0);
	        			ClearAnimations(playerid);
    	    			TogglePlayerControllable(playerid,0);
						SetPVarInt(playerid, "IsFrozen", 0);
        				SetTimerEx("DescongelarCBUG",1500,false,"d",playerid);
					}
				}
			}
		}
	}
Reply
#2

Use esse: https://sampforum.blast.hk/showthread.php?tid=145416
Reply
#3

Adicione a variavel no нnicio do GM.

PHP код:
new AvisoCBUG[MAX_PLAYERS]; 
Coloque na public OnPlayerKeyStateChange

PHP код:
if(AvisoCBUG[playerid] == 1)
        {
            
SCM(playerid,-1,"Nгo faзas c-bug, ficas congelado por 3 segundos.");
            
TogglePlayerControllable(playerid,0);
            
SetPVarInt(playerid"IsFrozen"0);
            
SetTimerEx("DescongelarCBUG",3000,false,"d",playerid);
            
AvisoCBUG[playerid] = 0;
        }
if(
newkeys == KEY_HANDBRAKE)
    {
        if(
IsPlayerInAnyVehicle(playerid)) return 1;
        if(
GetPlayerWeapon(playerid) > 20)
        {
            if(
AvisoCBUG[playerid] == 0)
            {
                
AvisoCBUG[playerid] = 1;
                
SetTimerEx("AntiCBug",1000,false,"d",playerid);
            }
        }
    } 
Criar as forwards

PHP код:
forward DescongelarCBUG(playerid);
public  
DescongelarCBUG(playerid)
{
    
TogglePlayerControllable(playerid,1);
    
SetPVarInt(playerid"IsFrozen"1);
}
forward AntiCBug(playerid);
public 
AntiCBug(playerid)
{
    
AvisoCBUG[playerid] = 0;

Reply
#4

Quote:
Originally Posted by Koplan
Посмотреть сообщение
Adicione a variavel no нnicio do GM.

PHP код:
new AvisoCBUG[MAX_PLAYERS]; 
Coloque na public OnPlayerKeyStateChange

PHP код:
if(AvisoCBUG[playerid] == 1)
        {
            
SCM(playerid,-1,"Nгo faзas c-bug, ficas congelado por 3 segundos.");
            
TogglePlayerControllable(playerid,0);
            
SetPVarInt(playerid"IsFrozen"0);
            
SetTimerEx("DescongelarCBUG",3000,false,"d",playerid);
            
AvisoCBUG[playerid] = 0;
        }
if(
newkeys == KEY_HANDBRAKE)
    {
        if(
IsPlayerInAnyVehicle(playerid)) return 1;
        if(
GetPlayerWeapon(playerid) > 20)
        {
            if(
AvisoCBUG[playerid] == 0)
            {
                
AvisoCBUG[playerid] = 1;
                
SetTimerEx("AntiCBug",1000,false,"d",playerid);
            }
        }
    } 
Criar as forwards

PHP код:
forward DescongelarCBUG(playerid);
public  
DescongelarCBUG(playerid)
{
    
TogglePlayerControllable(playerid,1);
    
SetPVarInt(playerid"IsFrozen"1);
}
forward AntiCBug(playerid);
public 
AntiCBug(playerid)
{
    
AvisoCBUG[playerid] = 0;

Resultou, porйm a pessoa se der um tiro sem C-bug й congelada da mesma forma que estivesse fazendo.

Corrigido! Substitui

Код:
if(newkeys == KEY_HANDBRAKE)
por

Код:
if ((newkeys & KEY_FIRE) && (newkeys & KEY_CROUCH))
Obrigado Koplan!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)