SA-MP Forums Archive
[DUDA] Anti-cheat de armas - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [DUDA] Anti-cheat de armas (/showthread.php?tid=407099)



[DUDA] Anti-cheat de armas - Glimma - 12.01.2013

Buenas, ando necesitando urgente un anti-cheat de armas, asн que me planteй una forma posible de hacerlo..

Se me ocurriу crear un stock tipo GivePlayerWeapon, pero que en йsta tambiйn de una variable que por ejemplo sea ArmaSegura. Entonces en OnPlayerTakeDamage, al recibir un daсo con un arma que no tenga la variable ArmaSegura haga que se le desaparezcan sus armas.

їEs una buena forma o me recomiendan otra?


Respuesta: [DUDA] Anti-cheat de armas - NeuZz - 12.01.2013

hazlo asн xd pero en onplayerdeatch para menos recursos


Respuesta: [DUDA] Anti-cheat de armas - -[R]hysi- - 12.01.2013

Te recomiendo.

https://sampforum.blast.hk/showthread.php?tid=288514


Podes tomarlo de base o usar la misma idea.Es muy efectivo ese anti armas


Respuesta: [DUDA] Anti-cheat de armas - CaptainMactavish - 13.01.2013

Quote:
Originally Posted by NeuZz
Посмотреть сообщение
hazlo asн xd pero en onplayerdeatch para menos recursos


Volviendo al tema, podes hacer algo asн:
pawn Код:
new PlayerWeapons[MAX_PLAYERS][13][2];

public OnPlayerConnect(playerid)
{
    for(new i;i<13;i++) PlayerWeapons[playerid][i][0] = 0, PlayerWeapons[playerid][i][1] = 0;
    //Reinicia las variables que contiene los datos de las armas
    return 1;
}

public OnGameModeInit()
{
    //...
    SetTimer("AntiWeaponHack", 1000, 1); //Pone un timer que chequee las armas de todos cada 1000 milisegundos (1 segundo) y de infinitas repeticiones
    return 1;
}

forward AntiWeaponHack();
public AntiWeaponHack()
{
    static weap, slot;
    for(new i;i<MAX_PLAYERS;i++) if(IsPlayerConnected(i))
    {
        weap = GetPlayerWeapon(i);
        slot = GetWeaponSlot(weap);
        if(PlayerWeapons[i][slot][0] != weap || PlayerWeapons[i][slot][1] != GetPlayerAmmo(i))
            //Codigo de ban por hack de armas
        }
    }
}
stock GetWeaponSlot(weaponid)
{
    new slot;
    switch(weaponid)
    {
        case 0,1: return 0;
        case 2 .. 9: return 1;
        case 10 .. 15: return 10;
        case 16 .. 18, 39: return 8;
        case 22 .. 24: return 2;
        case 25 .. 27: return 3;
        case 28, 29, 32: return 4;
        case 30, 31: return 5;
        case 33, 34: return 6;
        case 35 .. 38: return 7;
        case 40: return 12;
        case 41 .. 43: return  9;
        case 44 .. 46: return 11;
    }
    return -1;
}
Es algo bбsico, agregale lo que necesites.


Respuesta: [DUDA] Anti-cheat de armas - Frenzi - 13.01.2013

Quote:
Originally Posted by CaptainMactavish
Посмотреть сообщение


Volviendo al tema, podes hacer algo asн:
pawn Код:
new PlayerWeapons[MAX_PLAYERS][13][2];

public OnPlayerConnect(playerid)
{
    for(new i;i<13;i++) PlayerWeapons[playerid][i][0] = 0, PlayerWeapons[playerid][i][1] = 0;
    //Reinicia las variables que contiene los datos de las armas
    return 1;
}

public OnGameModeInit()
{
    //...
    SetTimer("AntiWeaponHack", 1000, 1); //Pone un timer que chequee las armas de todos cada 1000 milisegundos (1 segundo) y de infinitas repeticiones
    return 1;
}

forward AntiWeaponHack();
public AntiWeaponHack()
{
    static weap, slot;
    for(new i;i<MAX_PLAYERS;i++) if(IsPlayerConnected(i))
    {
        weap = GetPlayerWeapon(i);
        slot = GetWeaponSlot(weap);
        if(PlayerWeapons[i][slot][0] != weap || PlayerWeapons[i][slot][1] != GetPlayerAmmo(i))
            //Codigo de ban por hack de armas
        }
    }
}
stock GetWeaponSlot(weaponid)
{
    new slot;
    switch(weaponid)
    {
        case 0,1: return 0;
        case 2 .. 9: return 1;
        case 10 .. 15: return 10;
        case 16 .. 18, 39: return 8;
        case 22 .. 24: return 2;
        case 25 .. 27: return 3;
        case 28, 29, 32: return 4;
        case 30, 31: return 5;
        case 33, 34: return 6;
        case 35 .. 38: return 7;
        case 40: return 12;
        case 41 .. 43: return  9;
        case 44 .. 46: return 11;
    }
    return -1;
}
Es algo bбsico, agregale lo que necesites.
їPero eso no laguearнa el servidor? Digo, por el timer.


Re: [DUDA] Anti-cheat de armas - captainjohn - 13.01.2013

Hola, comprobar las secuencias de comandos aquн.

usted puede encontrar anti-cheat de armas
https://sampforum.blast.hk/showthread.php?tid=356383


https://sampforum.blast.hk/showthread.php?tid=133395


Respuesta: [DUDA] Anti-cheat de armas - Fluid016 - 13.01.2013

Quote:
Originally Posted by Frenzi
Посмотреть сообщение
їPero eso no laguearнa el servidor? Digo, por el timer.
Con un simple timer no se laguea el servidor y tambiйn depende de como estй optimizada la callback que es llamada con el timer y depeden de todos los timer que tiene y como usa onplayerupdate.