[AJUDA] Anti-Jogo Bugado
#1

TIPO MEU ANTI JOGO TA COM 1 BUG ESTRANHO EU VO NA ARENA DE MINIGUN N TOMO KICK AI TA SERTO MAIS AI QUANDO DIGITO /sairdm pra sair da arena de minigun eu as veses n e sempre tomo kick motivo minigun mais e so as veses olha o sistema a baixo

PHP код:
#include <a_samp>
#if !defined COLOR_YELLOW
#define COLOR_YELLOW 0xFFFF00AA
#endif
new Hack[MAX_PLAYERS];
public 
OnGameModeInit()
{
    
SetTimer("HackChecar"1000true);
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
Hack[playerid] = 0;
    return 
1;
}
forward HackChecar();
public 
HackChecar()
{
    for(new 
playerid 0slot GetMaxPlayers(); playerid != slotplayerid++)
    {
        if(
Hack[playerid] == 1)
        {
            if(
IsPlayerConnected(playerid) && !IsPlayerAdmin(playerid))
            {
                new 
string[256];
                if(
GetPlayerWeapon(playerid) == 36)
                {
                    new 
foundname[MAX_PLAYER_NAME];
                    
GetPlayerName(playeridfoundnameMAX_PLAYER_NAME);
                    
format(stringsizeof(string), "{FA053A}[Anti-Jogo]:{FAE605} %s[ID:%d] foi kickado por usar arma proibida! {FA053A}(Lanзador de Mнsseis Automбtico)"foundnameplayerid);
                    
SendClientMessageToAll(COLOR_YELLOWstring);
                    
SendClientMessage(playerid,-1,"{FA053A} - Vocк foi kickado por usar arma proibida! {FA053A}(Lanзador de Mнsseis Automбtico)");
                    
Kick(playerid);
                }
                if(
GetPlayerWeapon(playerid) == 37)
                {
                    new 
foundname[MAX_PLAYER_NAME];
                    
GetPlayerName(playeridfoundnameMAX_PLAYER_NAME);
                    
format(stringsizeof(string), "{FA053A}[Anti-Jogo]:{FAE605} %s[ID:%d] foi kickado por usar arma proibida! {FA053A}(Lanзador de Chamas)"foundnameplayerid);
                    
SendClientMessageToAll(COLOR_YELLOWstring);
                    
SendClientMessage(playerid,-1,"{FA053A} - Vocк foi kickado por usar arma proibida! {FA053A}(Lanзador de Chamas)");
                    
Kick(playerid);
                }
                if(
GetPlayerWeapon(playerid) == 35)
                {
                    new 
foundname[MAX_PLAYER_NAME];
                    
GetPlayerName(playeridfoundnameMAX_PLAYER_NAME);
                    
format(stringsizeof(string), "{FA053A}[Anti-Jogo]:{FAE605} %s[ID:%d] foi kickado por usar arma proibida! {FA053A}(Lanзador de Mнsseis)"foundnameplayerid);
                    
SendClientMessageToAll(COLOR_YELLOWstring);
                    
SendClientMessage(playerid,-1,"{FA053A} - Vocк foi kickado por usar arma proibida! {FA053A}(Lanзador de Mнsseis)");
                    
Kick(playerid);
                }
                if(
GetPlayerWeapon(playerid) == 38)
                {
                    new 
foundname[MAX_PLAYER_NAME];
                    
GetPlayerName(playeridfoundnameMAX_PLAYER_NAME);
                    
format(stringsizeof(string), "{FA053A}[Anti-Jogo]:{FAE605} %s[ID:%d] foi kickado por usar arma proibida! {FA053A}(Minigun)"foundnameplayerid);
                    
SendClientMessageToAll(COLOR_YELLOWstring);
                    
SendClientMessage(playerid,-1,"{FA053A} - Vocк foi kickado por usar arma proibida! {FA053A}(Minigun)");
                    
Kick(playerid);
                }
            }
        }
    }
    return 
true;
}
public 
OnPlayerSpawn(playerid)
{
    
Hack[playerid] = 1;
    return 
1;
}
/*No comando coloque isso:
   Hack[playerid] = 0;
*/ 
Reply
#2

Adcione essa funзгo no final do gamemode:
pawn Код:
RemovePlayerWeapon(playerid, weaponid)
{
    if(!IsPlayerConnected(playerid) || weaponid < 0 || weaponid > 50)
      return;

    new
      saveweapon[13],
      saveammo[13];
     
    // Probably could be done using one loop
    for(new slot = 0; slot < 13; slot++)
      GetPlayerWeaponData(playerid, slot, saveweapon[slot], saveammo[slot]);

    ResetPlayerWeapons(playerid);

    for(new slot; slot < 13; slot++)
    {
        if(saveweapon[slot] == weaponid || saveammo[slot] == 0)
            continue;

        GivePlayerWeapon(playerid, saveweapon[slot], saveammo[slot]);
    }

    // give them weapon ID 0 to reset the current armed weapon
    // to a fist and not the last weapon in their inventory
    GivePlayerWeapon(playerid, 0, 1);

}
Use-a no comando:
pawn Код:
//Exemplo:
RemovePlayerWeapon(playerid, 38);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)