SA-MP Forums Archive
[Ajuda]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: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda]Armas (/showthread.php?tid=295927)



[Ajuda]Armas - Mteck - 08.11.2011

queria que os zombies tivessem sу moto-serra e faca, mais quando coloca pra eles nascerem com isso as armas somem, por causa do ant-hack, e tipo os humanos nгo podem pegar moto-serra sу os zombies alguem pode me ajudar ?

pawn Код:
public AntiCheatHack()
{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        new weap = GetPlayerWeapon(i);
        if(weap == 18 || weap == 38 || weap == 36 || weap == 37 || weap == 35 || weap == 44)
        {
            ResetPlayerWeapons(i);
            ResetPlayerWeapons(i);
            new string[128];
            new pName[MAX_PLAYER_NAME];
            GetPlayerName(i, pName, sizeof(pName));
            format(string, sizeof(string), "%s estб usando armas proibidas !", pName);
            MsgAdm(string, YELLOW, 1);
  }
        if(gTeam[i] == TEAM_ZOMBIE)
        {
            switch (GetPlayerWeapon(i))
            {
                case 1,2,3,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46:
                {
                    ResetPlayerWeapons(i);
                    GivePlayerWeapon(i, 0, 1);
                }
            }
        }
    }
    return 1;
}



Re: [Duvida]Armas - DreeH - 08.11.2011

PHP код:
public AntiCheatHack()
{
    new 
string[128];
    new 
pName[MAX_PLAYER_NAME];
    for(new 
0MAX_PLAYERS++)
    {
        new 
weap GetPlayerWeapon(i);
        if(
weap == 18 || weap == 38 || weap == 36 || weap == 37 || weap == 35 || weap == 44)
        {
            
GetPlayerName(ipNamesizeof(pName));
            
ResetPlayerWeapons(i);
            
format(stringsizeof(string), "%s estб usando armas proibidas !"pName);
            
MsgAdm(stringYELLOW1);
        }
        if(
gTeam[i] == TEAM_ZOMBIE)
        {
            switch (
GetPlayerWeapon(i))
            {
                case 
1,2,3,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46:
                {
                    
ResetPlayerWeapons(i);
                    
SetPlayerHealth(i100.0);
                    
SetPlayerArmour(i50.0);
                    
GivePlayerWeapon(i150);
                    
GivePlayerWeapon(i4520);
                    
GivePlayerWeapon(i9500);
                }
            }
            if(
gTeam[i] == TEAM_HUMAN)
            {
                 
SetPlayerHealth(i100.0);
                 
SetPlayerArmour(i50.0);
                 
GivePlayerWeapon(i,24,100);
                 
GivePlayerWeapon(i,29,250);
                 
GivePlayerWeapon(i,25,56);
                 
GivePlayerWeapon(i4650);
                 return 
1;
             }
        }
    }
    return 
1;

Testa.


Re: [Duvida]Armas - Enderman - 08.11.2011

Cara deve ser problema de return

pois a Knife e a moto-serra estгo habilitados para os zumbis

case 1,2,3,5,6,7,8,10,

faca й o id 4, motoserra id 9


Re: [Duvida]Armas - DreeH - 08.11.2011

Quote:
Originally Posted by Enderman
Посмотреть сообщение
Cara deve ser problema de return

pois a Knife e a moto-serra estгo habilitados para os zumbis

case 1,2,3,5,6,7,8,10,

faca й o id 4, motoserra id 9
Quote:

[...] e tipo os humanos nгo podem pegar moto-serra sу os zombies alguem pode me ajudar ?

Leia melhor o pedido dele.


Re: [Duvida]Armas - Mteck - 09.11.2011

bom, o comando funciono sу que tipo a arma fica setando toda hora pros zombies nгo da pra trocar. e quando o humano ta morrendo o life volta tudo denoovo.;-.


Re: [Duvida]Armas - Mteck - 09.11.2011

#malz o double mais preciso de ajuda ;/

a arma fica setando toda hora na mгo dos humanos e dos zombies ;s mesma coisa assim eu tiro life dos humanos e depois volta ao normal :@

seria isso ?Resetplayerweapons

pawn Код:
switch (GetPlayerWeapon(i))
            {
                case 1,2,3,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46:
                {
                    ResetPlayerWeapons(i);
                    SetPlayerHealth(i, 100.0);
                    SetPlayerArmour(i, 50.0);
                    GivePlayerWeapon(i, 1, 50);
                    GivePlayerWeapon(i, 4, 520);
                    GivePlayerWeapon(i, 9, 500);
                }
            }



Re: [Duvida]Armas - iansinho - 09.11.2011

Quote:
Originally Posted by Mteck
Посмотреть сообщение
#malz o double mais preciso de ajuda ;/

a arma fica setando toda hora na mгo dos humanos e dos zombies ;s mesma coisa assim eu tiro life dos humanos e depois volta ao normal :@

seria isso ?Resetplayerweapons

pawn Код:
switch (GetPlayerWeapon(i))
            {
                case 1,2,3,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46:
                {
                    ResetPlayerWeapons(i);
                    SetPlayerHealth(i, 100.0);
                    SetPlayerArmour(i, 50.0);
                    GivePlayerWeapon(i, 1, 50);
                    GivePlayerWeapon(i, 4, 520);
                    GivePlayerWeapon(i, 9, 500);
                }
            }
Й porque, provavelmente, й utilizado um SetTimer na public...
Tenho que ir pra escola agora, senгo te ajudava.


Re: [Ajuda]Armas - Lуs - 09.11.2011

pawn Код:
public AntiCheatHack()
{
    new string[128];
    new pName[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        new weap = GetPlayerWeapon(i);
        if(weap == 18 || weap == 38 || weap == 36 || weap == 37 || weap == 35 || weap == 44)
        {
            GetPlayerName(i, pName, sizeof(pName));
            ResetPlayerWeapons(i);
            format(string, sizeof(string), "%s estб usando armas proibidas !", pName);
            MsgAdm(string, YELLOW, 1);
        }
        if(gTeam[i] == TEAM_ZOMBIE)
        {
             if(weap != 1 || weap != 4 || weap != 9) return ResetPlayerWeapons(i);
             GivePlayerWeapon(i, 1, 1);    
             GivePlayerWeapon(i, 4, 1);
             GivePlayerWeapon(i, 9, 1);
        }
        if(gTeam[i] == TEAM_HUMAN)
        {
             SetPlayerHealth(i, 100.0);
             SetPlayerArmour(i, 50.0);
             GivePlayerWeapon(i, 24,100);
             GivePlayerWeapon(i, 29,250);
             GivePlayerWeapon(i, 25,56);
             GivePlayerWeapon(i, 46, 50);
        }
    }
    return 1;
}
Nгo garanto que vai funcionar pois estou no trampo |:

@edit

Vocк deve estar usando um timer nessa public para checkar o anti hack.


Re: [Ajuda]Armas - Mteck - 09.11.2011

pawn Код:
SetTimer("AntiCheatHack",500,true);
essa?


Re: [Ajuda]Armas - Lуs - 09.11.2011

Isso mesmo.

pawn Код:
if(gTeam[i] == TEAM_ZOMBIE)
        {
             if(weap != 1 || weap != 4 || weap != 9) return ResetPlayerWeapons(i);
             GivePlayerWeapon(i, 1, 1);    
             GivePlayerWeapon(i, 4, 1);
             GivePlayerWeapon(i, 9, 1);
        }
        if(gTeam[i] == TEAM_HUMAN)
        {
             SetPlayerHealth(i, 100.0);
             SetPlayerArmour(i, 50.0);
             GivePlayerWeapon(i, 24,100);
             GivePlayerWeapon(i, 29,250);
             GivePlayerWeapon(i, 25,56);
             GivePlayerWeapon(i, 46, 50);
        }
Isso significa que cada vez que checar a public (500 milisegundos) ele vai dar as armas e Setar a vida e colete dos humanos.