[Ajuda] Dano Armas
#1

A Bazuka WEAPON == 35 e a granada WEAPON == 16, nгo estгo tirando dano no meu servidor.
Bom teoricamente й fбcil alterar, fui na Public OnPlayerGiveDamage e na Public OnPlayerTakeDamage, e nгo tinha nada lб zerando o dano destas duas armas. Tentei definir um dano pra essas armas e mesmo assim o dano continua zerado. O que pode ser que esteja acontecendo? Uma calback que eu nгo sei onde estб, estб zerando o dano delas? Ou, tem possibilidade de ser alguma include?
PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloat:amountweaponidbodypart)
{
    if((
pmorto[damagedid]))return 1;
    if((
PlayerInfo[damagedid][pAdmin]&&admtrampando[damagedid])||
    (
PlayerInfo[damagedid][pHelper]&&helpertrampando[damagedid]))return 1;
    if(
GetPVarInt(damagedid"HD"))return 1;
    if(
GetPlayerOrg(playerid) == && GetPlayerOrg(damagedid) == && IsPlayerInRC(playerid))
    {
        
ShowPlayerDialog(playerid8724DIALOG_STYLE_MSGBOX,
        
"{FFFFFF}» Proibido fazer {FF0000}Death-Match",
        
"{FFFFFF}» Vocк nгo pode bater em um civil proximo a{FF0000} Areas Neutras\n\
        {FFFFFF}Caso faзa novamente, serб {FF0000}Preso por um admin!"
"OK","");
        
ApplyAnimation(playerid,"PED","handscower",4.1,0,1,1,0,0);
        return 
1;
    }
    if(
PlayerInfo[playerid][pJailed] && PlayerInfo[damagedid][pJailed])
    {
        
ShowPlayerDialog(playerid8724DIALOG_STYLE_MSGBOX,
        
"{FFFFFF}» Proibido fazer {FF0000}Death-Match",
        
"{FFFFFF}» Vocк nгo pode bater em alguem enquanto estiver{FF0000} Na cadeia\n\
        {FFFFFF}Caso faзa novamente, serб {FF0000}Ajustado por um admin!"
"OK","");
        
ApplyAnimation(playerid,"PED","handscower",4.1,0,1,1,0,0);
        return 
1;
    }
    
//Dano das Armas
    
switch(weaponid)
    {
        case 
24:amount 22.0//Eagle
        
case 25:amount 35.0//Shotgun
        
case 26:amount 10.0//Sawnoff Shotgun
        
case 27:amount 12.0//Combat Shotgun
        
case 29:amount 5.0;  //MP5
        
case 30:amount 10.0//AK-47
        
case 31:amount 10.0//M4
        
case 32:amount 3.0;  //Tec-9
        
case 38:amount 0.0;  //Minigun
        
case 34:               //Sniper Rifle
        
{
              if(!
ProxDetectorS(50.0playeriddamagedid)){
                if(
bodypart == 9){
                    if(
GetPlayerState(damagedid) == PLAYER_STATE_ONFOOT){
                        return 
InitHeadShot(playeriddamagedid);
                    }
                }
                
amount 70.0;
            }
            else{
                
amount 0.0;
                
SendClientMessage(damagedidCOLOR_YELLOW"Dano Bloqueado, Sniper de perto й proibido!");
                
SendClientMessage(playeridCOLOR_YELLOW"Dano Bloqueado, Sniper de perto й proibido!");
            }
            
TextDrawShowForPlayer(playeridtextXizinho);
        }
    }
     new
         
string[128]
     ;
     if(
weaponid == 29)
      {
           if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(damagedid) == PLAYER_STATE_ONFOOT)
        {
            
format(stringsizeof string"Й proibido fazer DB neste servidor!"PlayerName(damagedid), damagedid);
             
SendClientMessage(playeridCOLOR_DBLUEstring);
            
SetPlayerArmedWeapon(playerid0);
            
amount 0.0;
        }
    }
    
// /DM
    
DMSystem[playerid][damagedid]=true;
    
SetPVarInt(damagedid"VarDano"gettime()+60);
//------------- Retirar Vida/Colete ------------------
    
PlayerPlaySound(damagedid17802,  0.00.00.0);
    new
        
Float:Life,
        
Float:Coleete,
        
Float:Dano
    
;
    
GetPlayerArmour(damagedidColeete);
    
GetPlayerHealth(damagedidLife);
    if(
Coleete 0)
    {
        if(
amount Coleete)
        {
            
Dano amount Coleete;
            
Life Life Dano;
            if(
Life <= 0)
            {
                
setarhospital(damagedid);
                
SetPlayerVirtualWorld(damagediddamagedid+1);
                
OnPlayerDeathEx(damagedidplayeridweaponid);
                
pmorto[damagedid] = true;
            }
            
SetPlayerArmour(damagedid0.0);
            
SetPlayerHealth(damagedidLife);
        }
        else
        {
            
Coleete Coleete amount;
            
SetPlayerArmour(damagedidColeete);
        }
    }
    else if(
Coleete 1)
    {
        
Life Life amount;
        if(
Life <= 0)
        {
            
setarhospital(damagedid);
            
SetPlayerVirtualWorld(damagediddamagedid+1);
            
OnPlayerDeathEx(damagedidplayeridweaponid);
            
pmorto[damagedid] = true;
        }
        
SetPlayerHealth(damagedidLife);
    }
//------------------------------------------------------------------------------
//playerid
    
format(string20"{00FF00}+%.0f"amount);
     
Update3DTextLabelText(labelDano[playerid], 0xFFFFFFF6string);
    
KillTimer(TempoMostrarLife[playerid]);
    
format(string,sizeof(string),"~>~ ~g~~h~%s~n~         ~g~~h~+%0.0f DMG~n~~p~Arma: ~w~~h~%s"NomePlayer(damagedid), amountNomeArma(weaponid));
    
PlayerTextDrawSetString(playeridtextinfodamage[playerid][1], string);
    
PlayerTextDrawShow(playeridtextinfodamage[playerid][0]);
    
PlayerTextDrawShow(playeridtextinfodamage[playerid][1]);
    
TempoMostrarLife[playerid] = SetTimerEx("HideTextoLife"6000"i"playerid);
    
MostrandoVida[playerid] = 1;
//------------------------------------------------------------------------------
//Damagedid
    
format(string20"{FF0000}-%.0f"amount);
     
Update3DTextLabelText(labelDano[damagedid], 0xFFFFFFF6string);
    
KillTimer(TempoMostrarLife[damagedid]);
    
format(string,sizeof(string),"~>~ ~r~~h~%s~n~         ~r~~h~-%0.0f DMG~n~~p~Arma: ~w~~h~%s"NomePlayer(playerid), amountNomeArma(weaponid));
    
PlayerTextDrawSetString(damagedidtextinfodamage[damagedid][1], string);
    
PlayerTextDrawShow(damagedidtextinfodamage[damagedid][0]);
    
PlayerTextDrawShow(damagedidtextinfodamage[damagedid][1]);
    
TempoMostrarLife[damagedid] = SetTimerEx("HideTextoLife"6000"i"damagedid);
    
MostrandoVida[damagedid] = 1;
//------------------------------------------------------------------------------
    
updatetextlife(damagedid);
    return 
1;

Reply
#2

Em seu OnPlayerGiveDamage, tente assim:

PHP код:
    new Float:vidaFloat:colete;
    
GetPlayerHealthdamagedidvida );
    
GetPlayerArmourdamagedidcolete );
    if(
weaponid == 16// GRANADA
    
{       // Id da arma
        
if(colete >= 1
        {
            
SetPlayerArmour(damagedidcolete 40.0);//colete
        
}
        else
        {
            
SetPlayerHealth(damagedidvida 40.0);//vida
        
}
    } 
@OFF
Cara, um conselho que lhe dou й:
Esse gamemode do Brasil PlayFacil/PlayStart (tudo cуpia um do outro, literalmente cуpia.) й completamente bugado, caso vocк esteja estudando recomendo que pegue um GM mais simples, atй porque, mais de 110 mil linhas й muita coisa para quem estб comeзando ou estudando, enfim, se vocк estiver ajustando o GM para futuramente abrir um servidor, recomendo que faзa um gamemode ъnico, pois o publico jб estб cansado de ver esse gamemode.
Reply
#3

Opa, Boa Noite !
Obrigado pelo conselho. Sobre o cуdigo vou testar aqui e falo o resultado que obtive.
Reply
#4

Nгo funcionou, estou tentando de tudo pro dano dessas armas pegarem e nгo estou obtendo sucesso!
Estava vasculhando as includes, achei uma que poderia estar bloqueando o dano das armas, editei a include removendo o que poderia estar removendo o dano das armas e novamente nгo obtive sucesso.
PHP код:
Anti Cheater Feito por dimmy_scarface


-------------------------Anti Cheaters------------------------------------------

Anti-Xiters:

                
Nomes                  Precisгo

        
Anti Car-AirBreak             95%
        - 
Anti Player-AirBreak          95%
        - 
Anti Teleport                 100%
         - 
Anti Speed Hack                 100%
        - 
Anti Money-Hack               100%
        - 
Anti Armour-Hack              100%
        - 
Anti Health-Hack              100%
        - 
Anti Divulguer                80%
        - 
Anti Fly-Hack                 95%
        - 
Anti Fake-Kill                90%
        - 
Anti State-Hack               100%
        - 
Anti JoyPad                   20% (Se acusarй porque estб usando mesmo)
        - 
Anti Weapon-Hack              90%
        - 
Anti Armas proibidas          100%
        - 
Anti Car-Flood                100%
        - 
Anti Rapid-Fire               100%
        - 
Anti No-Reload                100%
        - 
Anti Auto-CBUG Macro        100%
        - 
Anti Pro-Aimbot               100% (AimBot que puxa a skin)
        
//- Anti Puxar carros              85%



--------------------------------------------------------------------------------
*/






#define RangeAB         110.0
#define Range_Driver    150.0

#define Cheat:%0(%1) forward %0(%1); public %0(%1)


#define AirBreak_Teleport                (1)
#define Speed_Hack                      (2)
#define Money_Hack                      (3)
#define State_Hack                         (4)
#define Cheater_Fly                     (5)
#define Weapon_Hack                     (6)
#define Armour_Hack                        (7)
#define Fake_Kill                       (8)
#define Player_Divulguer                (9)
#define Player_Joypad                   (10)
#define Armas_Proibidas                 (11)
#define Health_Hack                     (12)
#define Rapid_Fire                       (13)
#define No_Reload                       (14)
#define Auto_Cbug                       (15)
#define Pro_Aim                         (16)
#define Warp_Car                        (17)
#define Bullet_Crasher                  (18)

new Slot_Weapon[MAX_PLAYERS][50];
new 
fAutoC[MAX_PLAYERS];

enum ctinfo
{
    
Float:PLAYER_POS_X,
    
Float:PLAYER_POS_Y,
    
Float:PLAYER_POS_Z,
    
Float:Teleport_X,
    
Float:Teleport_Y,
    
Float:Teleport_Z,
    
Float:Colete,
    
Float:cVida,
    
AGUARDO,
    
PLAYER_TIMER,
    
MONEY_PLAYER,
    
STATE_PLAYER,
    
RAPID_FIRE_EAGLE,
    
RAPID_FIRE_SHOTGUN,
    
RAPID_FIRE_SNIPER,
    
FAKE_KILL_PLAYER,
    
bool:PLAYER_WEAPON_HACK,
    
bool:Congelado,
};
new 
ds_info[MAX_PLAYERS][ctinfo];

public 
OnGameModeInit()
{
    
SetTimer("NONE"99999true);
    return 
CallLocalFunction("ab_OnGameModeInit""");
}
forward ab_OnGameModeInit();


public 
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{

    
/*------------------- Anti ProAim.cs ----------------------------*/

    
if(hittype == BULLET_HIT_TYPE_PLAYER)
       {

        if( !( -
1000.0 <= fX <= 1000.0 ) || !( -1000.0 <= fY <= 1000.0 ) || !( -1000.0 <= fZ <= 1000.0 ) ) // a valid offset, it's impossible that a offset bigger than 1000 is legit (also less than -1000.0 is impossible, not used by this hack, but still, let's check for it, just for the future, who knows what hacks will appear). The object with biggest offset is having ~700-800 radius.
        
{
            
CallLocalFunction("PlayerCheater","id"playeridBullet_Crasher);
            return 
0;
        }

        new 
Float:fOrigin[3], Float:fHitPos[3], Float:distFloat:dist2;
        
GetPlayerLastShotVectors(playeridfOrigin[0], fOrigin[1], fOrigin[2], fHitPos[0], fHitPos[1], fHitPos[2]);

        
dist GetPlayerDistanceFromPoint(hitidfHitPos[0], fHitPos[1], fHitPos[2]);
        
dist2 GetPlayerDistanceFromPoint(playeridfHitPos[0], fHitPos[1], fHitPos[2]);

        if(
dist2 4.0 && dist >= 30.0 && dist 300.0
        
&& GetPlayerSurfingVehicleID(playerid) == INVALID_VEHICLE_ID
        
&& GetPlayerState(hitid) == PLAYER_STATE_ONFOOT)
        {
            
LogAimbot(playeriddist2dist);

            
SetPVarInt(playerid"WarnningAimbot"GetPVarInt(playerid"WarnningAimbot") + 1);
            
CallLocalFunction("PlayerCheater","id"playeridPro_Aim);

        }
    }

    if (!
IsPlayerInAnyVehicle(playerid))
    {
        if(
weaponid == 25)
        {
            
ds_info[playerid][RAPID_FIRE_SHOTGUN] ++;
        }
        else if(
weaponid == 24)
        {
            
ds_info[playerid][RAPID_FIRE_EAGLE] ++;
            
fAutoC[playerid] ++;
        }
        else if(
weaponid == 34)
        {
            
ds_info[playerid][RAPID_FIRE_SNIPER] ++;
        }

        if(
ds_info[playerid][RAPID_FIRE_EAGLE] >= 11 || ds_info[playerid][RAPID_FIRE_SHOTGUN] >= || ds_info[playerid][RAPID_FIRE_SNIPER] >= 4)
        {
            
CallLocalFunction("PlayerCheater","id"playerid13);
            
SetPlayerArmedWeapon(playerid0);
        }
        if(
gettime() > GetPVarInt(playerid"UmSegundo")){

            
SetPVarInt(playerid"UmSegundo"gettime() + 1);
            
fAutoC[playerid] = 0;

        }else{
            if(
fAutoC[playerid] > 4){

                
CallLocalFunction("PlayerCheater","id"playeridAuto_Cbug);
                
fAutoC[playerid] = 0;
                
SetPVarInt(playerid"WarnningMacro"GetPVarInt(playerid"WarnningMacro") + 1);
            }
        }
    }
    
CallLocalFunction("ACBUG_OnPlayerWeaponShot""ddddfff"playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ);
    return 
1;
}
forward ACBUG_OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ);


stock isPlayerInWater(playerid)
{
    new 
Float:x,Float:y,Float:z;
    
GetPlayerPos(playeridxyz);
    if((
>= -1408.0629 && >= 2021.0587 && <= -460.9319 && <= 2861.4893) ||//Represa do deserto de Las Venturas
    
(>= 1269.5886 && >= -810.4507 && <= 1288.8916 && <= -800.5959) ||//Piscina de uma casa em VineWood (Mad Dog's Mansion)
    
(>= 1086.6010 && >= -683.6998 && <= 1103.0225 && <= -662.1832) ||//Piscina de uma casa em VineWood (Perto Mad Dog's Mansion)
    
(>= 169.6879 && >= -1392.6630 && <= 281.5444 && <= -1168.9749) ||// 2 Piscinas em VineWood
    
(>= -828.3018 && >= -2107.1487 && <= -443.5032 && <= -1855.6273) ||//Lago da бrvore caнda, ou Lago Morto
    
(>= 1198.9982 && >= -2407.0581 && <= 1275.7397 && <= -2341.6262) ||//Lago perto do aeroporto Los Santos
    
(>= 2293.1467 && >= -1432.5869 && <= 2331.7388 && <= -1397.6476) ||//Lago perto da Igreja Los Santos
    
(>= 1915.3196 && >= -1236.2382 && <= 2016.6565 && <= -1167.9290) ||//Park Glen Los Santos
    
(>= -2747.1692 && >= -510.1152 && <= -2663.2468 && <= -411.4905) ||//Lago em San Fierro
    
(>= 1838.8041 && >= 1463.2024 && <= 2035.4167 && <= 1703.0480) ||//Cascata do Login em Las Venturas
    
(>= 2049.6646 && >= 1843.3029 && <= 2119.9021 && <= 1983.5464) ||//Navio Pirata em Las Venturas
    
(>= 2094.9255 && >= 1085.2852 && <= 2179.1790 && <= 1183.0610) ||//Frente de um Cascino em Las Venturas
    
(>= 2545.3718 && >= 2347.7112 && <= 2593.6794 && <= 2403.8040) ||
    (
0xF))//No mar
    
{
     return 
1;
    }
    return 
0;
}


/*
isPlayerInWater(playerid)
{
    static Float:fX, Float:fY, Float:fZ;
    GetPlayerPos(playerid, fX, fY, fZ);
    if((fX >= 2044.6 && fX <= 2192.984 && fY >= 1206.358 && fY <= 1376.552) && fZ < 0xA) return 1;
    else if((fX >= 2048.504 && fX <= 2185.174 && fY >= 1063.239 && fY <= 1202.49) && fZ < 0xA) return 1;
    else if((fX >= 2204.698 && fX <= 2204.698 && fY >= 1426.837 && fY <= 1430.705) && fZ < 0xA) return 1;
    else if((fX >= 2032.885 && fX <= 2114.887 && fY >= 1852.325 && fY <= 1991.575) && fZ < 0xC) return 1;
    else if((fX >= 2517.086 && fX <= 2606.897 && fY >= 2316.493 && fY <= 2420.93) && fZ < 0x16) return 1;
    else if((fX >= 2554.5996 && fX <= 2507.7683 && fY >= 1548.6178 && fY <= 1588.9154) && fZ < 0xF) return 1;
    else if((fX >= -2043.628 && fX <= -1973.561 && fY >= -980.9415 && fY <= -724.0283) && fZ < 0x20) return 1;
    else if((fX >= -2753.912 && fX <= -2665.071 && fY >= -522.3632 && fY <= -380.3444) && fZ < 0x05) return 1;
    else if((fX >= 1219.864 && fX <= 1292.118 && fY >= -2435.881 && fY <= -2325.344) && fZ < 0xF) return 1;
    else if((fX >= 1923.388 && fX <= 2010.854 && fY >= -1223.924 && fY <= -1168.656) && fZ < 0x16) return 1;
    else if((fX >= 1269.301 && fX <= 1314.935 && fY >= -837.0452 && fY <= -781.7769) && fZ < 0x5A) return 1;
    else if((fX >= 1087.3953 && fX <= 1102.3138 && fY >= -682.6734 && fY <= -663.0043) && fZ < 0x71) return 1;
    else if((fX >= 1268.6118 && fX <= 1291.8774 && fY >= -784.2910 && fY <= -764.6104) && fZ < 0x43D) return 1;
    else if(fZ < 0xF) return 1;
    return 0;
}
*/
task AllCheater[1000](){

    new
        
Float:pXFloat:pYFloat:pZ,
        
Float:xFloat:yFloat:zFloat:r_r;
    foreach(new 
Player)
    {
        
GetPlayerPos(ipXpYpZ);
        if(
ds_info[i][AGUARDO] > 0)ds_info[i][AGUARDO]--;
        if(
ds_info[i][STATE_PLAYER] > 0)ds_info[i][STATE_PLAYER]--;
        if(
ds_info[i][FAKE_KILL_PLAYER] > )ds_info[i][FAKE_KILL_PLAYER]--;

        
x             ds_info[i][PLAYER_POS_X],
        
y             ds_info[i][PLAYER_POS_Y],
        
z             ds_info[i][PLAYER_POS_Z];

        if(
IsPlayerInAnyVehicle(i))r_r Range_Driver;
        else 
r_r RangeAB;


        
/*---------------------- Anti Fly ---------------------------------*/
        
if(CheckAnim(i) && !isPlayerInWater(i) && PlayerVelocidade(i) > 20)
        {
                
CallLocalFunction("PlayerCheater","id"iCheater_Fly);
        }

        
/*---------------------- Speed Hack -------------------------------*/
        
else if(GetPlayerState(i) == PLAYER_STATE_DRIVER && PlayerVehicleSpeed(i) > 290 && !IsAPlane(GetPlayerVehicleID(i)))
        {
                
CallLocalFunction("PlayerCheater","id"iSpeed_Hack);
        }
        
/*---------------------- Anti AirBreak ou Teleport -----------------*/
        
else if(!IsPlayerInRangeOfPoint(ir_rxyz)
        && 
gettime() < ds_info[i][PLAYER_TIMER]
        && 
ds_info[i][AGUARDO] < 1
        
&& GetPlayerSurfingVehicleID(i) == 0xFFFF)
        {
            if((
GetPlayerState(i) == PLAYER_STATE_ONFOOT || GetPlayerState(i) == PLAYER_STATE_DRIVER))
            {
                if(!
IsPlayerInRangeOfPoint(i35.0,
                
ds_info[i][Teleport_X], ds_info[i][Teleport_Y], ds_info[i][Teleport_Z]))
                {
                    
CallLocalFunction"PlayerCheater" "id"AirBreak_Teleport ) ;
                }
            }
        }
        
ds_info[i][PLAYER_TIMER]             = gettime()+2;
        
ds_info[i][PLAYER_POS_X]             = pX;
        
ds_info[i][PLAYER_POS_Y]             = pY;
        
ds_info[i][PLAYER_POS_Z]             = pZ;

        
/*---------------------- Money Hack -------------------------------*/
        
if(GetPlayerMoney(i) != ds_info[i][MONEY_PLAYER])
        {
            
ResetPlayerMoney(i);
            
GivePlayerMoney(ids_info[i][MONEY_PLAYER]);
        }
        
        
/*---------------------- Armas Proibidas --------------------------*/
        
switch(GetPlayerWeapon(i))
        {
               case 
379262832353638223941:{
               
                  
CallLocalFunction("PlayerCheater","id"iArmas_Proibidas);
            }
        }

        static
            
Float:vidacolete
        
;
        
        
GetPlayerHealth(ividacolete);
        if(
vidacolete ds_info[i][cVida] && ds_info[i][cVida] > 0)
        {
            
SetPlayerHealth(ids_info[i][cVida]);
        }
        
GetPlayerArmour(ividacolete);
        if(
vidacolete ds_info[i][Colete])
        {
            
SetPlayerArmour(ids_info[i][Colete]);
        }
        
        
//---------------------- Rapid Fire --------------------------------*/
        
ds_info[i][RAPID_FIRE_EAGLE] = 0;
        
ds_info[i][RAPID_FIRE_SHOTGUN] = 0;
        
ds_info[i][RAPID_FIRE_SNIPER] = 0;
        
        
//----------------- Weapon Hack -------------------------------------*/
        
if(ds_info[i][AGUARDO] < 1){
        
            if((
GetPlayerWeapon(i)>10&&GetPlayerWeapon(i)<46&&GetPlayerAmmo(i)>0) && !Slot_Weapon[i][GetPlayerWeapon(i)]){
            
                
CallLocalFunction("PlayerCheater","id"iWeapon_Hack);
                   
ab_ResetPlayerWeapons(i);
            }
        }
    }
    
    return 
true;
}

stock GetWarnningMacroValue(playerid)
{
    return 
GetPVarInt(playerid"WarnningMacro");
}

//-------------- CallBacks ----------------------------------------------------
public OnEnterExitModShop(playeridenterexitinteriorid)
{
    
ds_info[playerid][AGUARDO] = 5;
    return 
CallLocalFunction("ab_OnEnterExitModShop""idd"playeridenterexitinteriorid);
}

forward ab_OnEnterExitModShop(playeridenterexitinteriorid);
public 
OnPlayerConnect(playerid)
{
    
ds_info[playerid][MONEY_PLAYER] = 0;
    
ds_info[playerid][STATE_PLAYER] = 0;
    
ds_info[playerid][FAKE_KILL_PLAYER] = 0;
    
ds_info[playerid][cVida] = 100.0;
    
ds_info[playerid][Colete] = 0.0;
    
ds_info[playerid][Congelado] = false;
    
ds_info[playerid][RAPID_FIRE_EAGLE] = 0;
    
ds_info[playerid][RAPID_FIRE_SHOTGUN] = 0;
    
ds_info[playerid][RAPID_FIRE_SNIPER] = 0;
    
ab_ResetPlayerWeapons(playerid);
    return 
CallLocalFunction("ab_OnPlayerConnect""i"playerid);
}
forward ab_OnPlayerConnect(playerid);

public 
OnPlayerSpawn(playerid)
{
    
ds_info[playerid][STATE_PLAYER] = 0;
    
ab_ResetPlayerWeapons(playerid);
    
ds_info[playerid][AGUARDO] = 10;
    
ds_info[playerid][cVida] = 100.0;
    
ds_info[playerid][Colete] = 0.0;
    
ds_info[playerid][RAPID_FIRE_EAGLE] = 0;
    
ds_info[playerid][RAPID_FIRE_SHOTGUN] = 0;
    
ds_info[playerid][RAPID_FIRE_SNIPER] = 0;
    
ds_info[playerid][Congelado] = false;
    
SetPlayerArmour(playerid0);
    return 
CallLocalFunction("ab_OnPlayerSpawn""i"playerid);
}
forward ab_OnPlayerSpawn(playerid);


public 
OnPlayerDeath(playeridkilleridreason)
{
    
ds_info[playerid][Congelado] = false;
    
/*----------------------- Fake Kill --------------------------------------*/
    
ds_info[playerid][FAKE_KILL_PLAYER]++;
    if(
ds_info[playerid][FAKE_KILL_PLAYER] > )
    {
        
CallLocalFunction("PlayerCheater","id"playeridFake_Kill);
        
ds_info[playerid][FAKE_KILL_PLAYER] = ;
        
SendClientMessage(playerid, -1"SERVER: Vocк foi banido deste servidor por suspeita de Fake Kill ou Crasher");
        
BanEx(playerid"Fake-Kill");
    }
    return 
CallLocalFunction("ab_OnPlayerDeath""iid"playeridkilleridreason);
}
forward ab_OnPlayerDeath(playeridkilleridreason);

public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    
/*----------------------- State Hack --------------------------------------*/
    
ds_info[playerid][STATE_PLAYER]++;
    
ds_info[playerid][AGUARDO] = 5;
    if(
ds_info[playerid][STATE_PLAYER] >= 6)
    {
            
CallLocalFunction("PlayerCheater","id"playeridState_Hack);
            
ds_info[playerid][STATE_PLAYER]=0;
            
SendClientMessage(playerid, -1"SERVER: Vocк foi kickado deste servidor por suspeita de State Hack ou Crasher");
            
Kick(playerid);
    }
    return 
CallLocalFunction("ab_OnPlayerStateChange""idd"playeridnewstateoldstate);
}
forward ab_OnPlayerStateChange(playeridnewstateoldstate);


public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{

    if(
newkeys KEY_CROUCH)
        
fAutoC[playerid] = 0;
        
    if(
GetPlayerState(playerid) == && (newkeys 2048 || newkeys 4096))
    {
        
CallLocalFunction("PlayerCheater","id"playeridPlayer_Joypad);
    }
    return 
CallLocalFunction("abb_OnPlayerKeyStateChange""idd"playeridnewkeysoldkeys);
}
forward abb_OnPlayerKeyStateChange(playeridnewkeysoldkeys);


new 
possiveis_dv[][] =
{
    
"ip.brasil",
    
":7777",
    
"PlayForever",
    
"PlayHorny",
    
"play horny",
    
"PlayGames",
    
"StartLife",
    
"PlayFacil",
    
":7779",
    
":8888",
    
":7778",
    
":7775",
    
"brasilplay",
    
"Brasil Play"
};

stock AntiDivulguer(playeridstring[])
{
    new 
nums 0ponts 0;
    for(new 
istrlen(string); i++)
    {
        if(
string[i] >= '0' && '9' >= string[i] || (string[i] == '.' || string[i] == ':')){
            if(
string[i] == '.' || string[i] == ':'){
                
ponts++;
            }
            else{
                
nums++;
            }
            if(
nums >= && ponts >= 3)
            {
                
CallLocalFunction("PlayerCheater","ids"playeridPlayer_Divulguerstring);
                
SendClientMessage(playerid, -1"{00EAF6}ANTICHEAT:{FFFFFF} Vocк foi acusado:{00EAF6} (Divulgando IP)");
                
SendClientMessage(playerid, -1"Info: Caso voce realmente nгo esteja divulgando um IP, avise imediatamente os admins usando /relatorio.");
                
SendClientMessage(playerid, -1"Info: Se vocк estiver divulgando outro servidor aqui, serб banido permanentemente sem chances de revisгo!");
                
SendClientMessage(playerid, -1"__________________________________________________________________________________________________________");
                return 
1;
            }
        }
    }

    for(new 
iDviDv sizeof(possiveis_dv); iDv++)
    {
           if(
strfind(stringpossiveis_dv[iDv], true) != -1)
           {
            
CallLocalFunction("PlayerCheater","ids"playeridPlayer_Divulguerstring);
            
SendClientMessage(playerid, -1"{00EAF6}ANTICHEAT:{FFFFFF} Vocк foi acusado:{00EAF6} (Divulgando IP)");
            
SendClientMessage(playerid, -1"Info: Caso voce realmente nгo esteja divulgando um IP, avise imediatamente os admins usando /relatorio.");
            
SendClientMessage(playerid, -1"Info: Se vocк estiver divulgando outro servidor aqui, serб banido permanentemente sem chances de revisгo!");
            
SendClientMessage(playerid, -1"__________________________________________________________________________________________________________");
            return 
1;
        }
    }
    return 
0;
}

public 
OnPlayerText(playeridtext[])
{
    if(
AntiDivulguer(playeridtext))return 0;
    if(!
strlen(text))return false;// < evitando um crasher do ******
    
return CallLocalFunction("ab_OnPlayerText""is"playeridtext);
}
forward ab_OnPlayerText(playeridtext[]);
//------------------------------------------------------------------------------

//PutPlayerInVehicle
Cheat:ab_PutPlayerInVehicle(playeridvehicleidseatid)
{
    new 
Float:xFloat:yFloat:z;
    
GetVehiclePos(vehicleidxyz);
    
ds_info[playerid][AGUARDO] = 5;

    
ds_info[playerid][Teleport_X] = x;
    
ds_info[playerid][Teleport_Y] = y;
    
ds_info[playerid][Teleport_Z] = z;
    
    
SetPVarInt(playerid"pCarSmasher"0);
    return 
PutPlayerInVehicle(playeridvehicleidseatid);
}

stock PlayerVelocidade(playerid)
{
    static 
Float:posS[3] ;
    
GetPlayerVelocity(playerid,posS[0],posS[1],posS[2]);
    return 
floatround(floatmul(floatsqroot(floatadd(floatpower(posS[0],2),floatpower(posS[1],2))),170.0));
}

PlayerVehicleSpeed(playerid)
{
    static 
Float:Spd[3];

    
GetVehicleVelocity(GetPlayerVehicleID(playerid),Spd[0],Spd[1],Spd[2]);
    return 
floatround(floatmul(floatsqroot(floatadd(floatpower(Spd[0],2),floatpower(Spd[1],2))),170.0));
}


//-------- MONEY ------------
Cheat:ab_GetPlayerMoney(playerid)
{
    return 
ds_info[playerid][MONEY_PLAYER];
}
Cheat:ab_GivePlayerMoney(playeridmoney)
{
    
ds_info[playerid][MONEY_PLAYER] = ds_info[playerid][MONEY_PLAYER]+=money;
    return 
true;
}
Cheat:ab_ResetPlayerMoney(playerid)
{
    return 
ds_info[playerid][MONEY_PLAYER] = 0;
}

stock ArmaSlot(armaid){

    switch(
armaid){
    
        case 
01:        return 0;
        case 
2..9:        return 1;
        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 
16..18,39:    return 8;
        case 
41..43:    return 9;
        case 
10..15:    return 10;
        case 
44..46:    return 11;
        case 
40:        return 12;
    }
    return 
0;
}

stock ab_TogglePlayerControllable(playeridstatus){

    if(
status){
    
        
ds_info[playerid][Congelado] = false;
    }else{
    
        
ds_info[playerid][Congelado] = true;
    }
    return 
TogglePlayerControllable(playeridstatus);
}

stock IsPlayerCongelado(playerid)
    return 
ds_info[playerid][Congelado];

Cheat:ab_GivePlayerWeapon(playeridweaponidammo)
{
    
ds_info[playerid][AGUARDO] = 5;

    
Slot_Weapon[playerid][weaponid] = true;
    
GivePlayerWeapon(playeridweaponidammo);
    return 
true;
}
Cheat:ab_ResetPlayerWeapons(playerid)
{
    
ds_info[playerid][AGUARDO] = 5;

    
ResetPlayerWeapons(playerid);

    for(new 
x!= 50x++){
    
        
Slot_Weapon[playerid][x] = false;
    }

    return 
true;
}




//-------------- FLY- Anim-------------
Cheat:CheckAnim(playerid)
{
    new 
animation GetPlayerAnimationIndex(playerid);
    if(
animation == 1539 || animation == 1538 || animation == 1543)
        return 
true;
    return 
0;
}

//--------------- SetPlayerPos ----------
Cheat:ab_SetPlayerPos(playeridFloat:pxFloat:pyFloat:pz)
{
    
ds_info[playerid][AGUARDO] = 6;

    
ds_info[playerid][PLAYER_POS_X] = px;
    
ds_info[playerid][PLAYER_POS_Y] = py;
    
ds_info[playerid][PLAYER_POS_Z] = pz;

    
ds_info[playerid][Teleport_X] = px;
    
ds_info[playerid][Teleport_Y] = py;
    
ds_info[playerid][Teleport_Z] = pz;
    return 
SetPlayerPos(playeridpxpypz);
}

Cheat:ab_SetVehiclePos(vehicleidFloat:xFloat:yFloat:z)
{
    foreach(new 
Player)
    {
        if(
IsPlayerInAnyVehicle(i) && GetPlayerVehicleID(i) == vehicleid)
        {
            
ds_info[i][AGUARDO] = 6;

            
ds_info[i][Teleport_X] = x;
            
ds_info[i][Teleport_Y] = y;
            
ds_info[i][Teleport_Z] = z;
        }
    }
    
SetVehiclePos(vehicleidxyz);
    return 
1;
}

//-------- COLETE/VIDA ---------
Cheat:ab_SetPlayerArmour(playeridFloat:armour)
{
    
ds_info[playerid][Colete] = armour;
    
SetPlayerArmour(playeridarmour);
    return 
updatetextlife(playerid);
}
Cheat:ab_SetPlayerHealth(playeridFloat:health)
{
    
ds_info[playerid][cVida] = health;
    
SetPlayerHealth(playeridhealth);
    return 
updatetextlife(playerid);
}

stock GetPlayerArmourBCS(playerid, &Float:colete){
    
colete ds_info[playerid][Colete];
}
stock GetPlayerHealthBCS(playerid, &Float:vida){
    
vida ds_info[playerid][cVida];
    return 
1;
}

#define GetPlayerHealth GetPlayerHealthBCS
#define GetPlayerArmour GetPlayerArmourBCS



public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
    if(
issuerid == INVALID_PLAYER_ID){
         
ds_info[playerid][cVida] -= amount;
    }
    return 
CallLocalFunction("ab_OnPlayerTakeDamage""ddfdd"playeridissueridamountweaponidbodypart);
}
forward ab_OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart);

#if defined _ALS_OnPlayerTakeDamage
    #undef OnPlayerTakeDamage
#else
    #define _ALS_OnPlayerTakeDamage
#endif
#define OnPlayerTakeDamage ab_OnPlayerTakeDamage


#if defined _ALS_OnGameModeInit
    #undef OnGameModeInit
#else
    #define _ALS_OnGameModeInit
#endif
#define OnGameModeInit ab_OnGameModeInit




#if defined _ALS_OnPlayerSpawn
    #undef OnPlayerSpawn
#else
    #define _ALS_OnPlayerSpawn
#endif
#define OnPlayerSpawn ab_OnPlayerSpawn




#if defined _ALS_OnPlayerStateChange
    #undef OnPlayerStateChange
#else
    #define _ALS_OnPlayerStateChange
#endif
#define OnPlayerStateChange ab_OnPlayerStateChange




#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
#else
    #define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect ab_OnPlayerConnect




#if defined _ALS_OnPlayerDeath
    #undef OnPlayerDeath
#else
    #define _ALS_OnPlayerDeath
#endif
#define OnPlayerDeath ab_OnPlayerDeath





#if defined _ALS_OnEnterExitModShop
    #undef OnEnterExitModShop
#else
    #define _ALS_OnEnterExitModShop
#endif
#define OnEnterExitModShop ab_OnEnterExitModShop





#if defined _ALS_OnPlayerText
    #undef OnPlayerText
#else
    #define _ALS_OnPlayerText
#endif
#define OnPlayerText ab_OnPlayerText





#if defined _ALS_OnPlayerKeyStateChange
    #undef OnPlayerKeyStateChange
#else
    #define _ALS_OnPlayerKeyStateChange
#endif
#define OnPlayerKeyStateChange abb_OnPlayerKeyStateChange





#if defined _ALS_OnPlayerWeaponShot
    #undef OnPlayerWeaponShot
#else
    #define _ALS_OnPlayerWeaponShot
#endif
#define OnPlayerWeaponShot ACBUG_OnPlayerWeaponShot





#if defined _ALS_SetPlayerArmour
    #undef SetPlayerArmour
#else
    #define _ALS_SetPlayerArmour
#endif
#define SetPlayerArmour                 ab_SetPlayerArmour





#if defined _ALS_SetPlayerHealth
    #undef SetPlayerHealth
#else
    #define _ALS_SetPlayerHealth
#endif
#define SetPlayerHealth                 ab_SetPlayerHealth



#define SetPlayerPos                    ab_SetPlayerPos
#define SetVehiclePos                    ab_SetVehiclePos
#define PutPlayerInVehicle              ab_PutPlayerInVehicle
#define GivePlayerMoney                 ab_GivePlayerMoney
#define GetPlayerMoney                     ab_GetPlayerMoney
#define ResetPlayerMoney                ab_ResetPlayerMoney
#define ResetPlayerWeapons              ab_ResetPlayerWeapons
#define GivePlayerWeapon                ab_GivePlayerWeapon
#define TogglePlayerControllable        ab_TogglePlayerControllable

forward PlayerCheater(playeridcheaterdescricao[]); 
Reply
#5

Remova isso de sua gamemode.

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 35)
    {
        
// One shot to kill with Rocket Launcher!
        
SetPlayerHealth(playerid0.0);
    }
    return 
1;

Com isso, a Bazuka voltarб a ter dano.
Estou dando uma olhada no gamemode para ver o que pode ser essa remoзгo de dano da granada.
Reply
#6

Estб parte eu jб tinha removido da minha GM, e mesmo assim nгo resolveu.
Essa funзгo aн, era pra matar apenas com um tiro de bazuka, nгo era?
Por isso estava achando que poderia ser esta include que mandei o cуdigo pra vc, mas, eu removi a parte de ARMAS_PROIBIDAS e mesmo assim nгo resolveu.
Estб muito estranho isto...
Reply
#7

Й como eu te disse cara, й um gamemode muito grande e repleto de bugs, nгo tem como procurar tudo que esteja relacionado a granada
Reply
#8

Obrigado pela tentativa de me ajudar, vou continuar tentando resolver ! Se mais alguйm tiver ideia do que seja, agradeceria pela ajuda!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)