[Ajuda]Ban Armas
#1

Alguem poderia me passa um codico de bans de armas que de ban ao jogador quando pegar a arma e nao de ban quando matar com a tal arma para poder levaar ban ?

desde jб fico grato!!
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerWeapon
Reply
#3

e como fasso para colocar mas armas na lista de ban ?
Reply
#4

pawn Code:
if((GetPlayerWeapon(killerid) == 38 || ID || ID) Ban(playerid);
Reply
#5

pawn Code:
if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN)
    {
        new string[256];
        new string2[256];
        new playrname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playrname, sizeof(playrname));
        format(string, sizeof(string), "\"%s\" foi banido . Razao: Xiter", playrname);
        SendClientMessageToAll(COR_AZUL, string);
        Ban(playerid);
        BanLog(string2);
    }
Reply
#6

Poo mas eu quero tipo assim ao player adiquirir aquela arma ele ser banido na mesma hora que ele pegar a arma.
Reply
#7

pawn Code:
public OnGameModeInit()
{
 SetTimer("Minun",60,true);
 return 1;
}

forward Minun(playerid);
public Minun(playerid)
{
if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN)
    {
        new string[256];
        new string2[256];
        new playrname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playrname, sizeof(playrname));
        format(string, sizeof(string), "\"%s\" foi banido . Razao: Xiter", playrname);
        SendClientMessageToAll(COR_AZUL, string);
        Ban(playerid);
        BanLog(string2);
    }
return 1;
}
Reply
#8

e para eu colocar mas armas?
Reply
#9

Quote:
Originally Posted by junioor
View Post
e para eu colocar mas armas?
pawn Code:
if(GetPlayerWeapon(playerid) == 36 || 12 || 1 )//e assim vai
    {
        new string[256];
        new string2[256];
        new playrname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playrname, sizeof(playrname));
        format(string, sizeof(string), "\"%s\" foi banido . Razao: Xiter", playrname);
        SendClientMessageToAll(COR_AZUL, string);
        Ban(playerid);
        BanLog(string2);
    }
return 1;
}
Reply
#10

Faz assim:

pawn Code:
#define YELLOW          0xFFFF00AA
#define HOMER           0xFF0000AA

forward CheckHacks();
public OnFilterScriptInit()//Ou OnGameModInit se for colocar no GM
{
    SetTimer("CheckHacks",1000,1);
    return 1;
}
public CheckHacks()
{
   new pName[MAX_PLAYER_NAME];
   new string[256];
   new string2[256];

   for(new i; i < MAX_PLAYERS; i++)
   {
     
      if(IsPlayerConnected(i))
      {

        if(GetPlayerWeapon(i) == IDDAARMA)
         {
         if(!IsPlayerAdmin(i)){
         GetPlayerName(i, pName, sizeof(pName));
         format(string,256,"| Anti-Cheat |  %s[ID:%d] Foi Banido, Motivo : NOMEDAARMA",pName,i);
         SendClientMessageToAll(HOMER,string);
         SendClientMessage(i, YELLOW,"| Anti-Cheat |: Vocк foi banido por usar NOMEDAARMA!.");
                 format(string2,256,"Banido por Cheat[NOMEDAARMA].");
                 BanEx(i, string2);//No caso o que estiver acima sera colocado na frente do nome do player no SAMP.BAN
                  }
         }
                        if(GetPlayerWeapon(i) == IDDAARMA)
         {
         if(!IsPlayerAdmin(i)){
         GetPlayerName(i, pName, sizeof(pName));
         format(string,256,"| Anti-Cheat |  %s[ID:%d] Foi Banido, Motivo : NOMEDAARMA",pName,i);
         SendClientMessageToAll(HOMER,string);
         SendClientMessage(i, YELLOW,"| Anti-Cheat |: Vocк foi banido por usar NOMEDAARMA!.");
                 format(string2,256,"Banido por Cheat[NOMEDAARMA].");
                 BanEx(i, string2);//No caso o que estiver acima sera colocado na frente do nome do player no SAMP.BAN
                  }
         }
//Vai repetindo a mesma coisa e mudando o ID e nomes

      }
   }
}//Pronto
Info: No caso ai banirб todo o player que estiver com qualquer arma que o ID estiver ali, e se for admin nгo banirб. As informaзгo sobre qual foi o Cheat apareceram no samp.ban (O que vocк colocar na string)

PS: Verifique as Cell, por que eu tirei algumas coisas que tinha entгo pode ter cells a mais. E obviamente tambйm pdoe estar faltando algumas coisas. Mas dб para se ter uma ideia.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)