[Ajuda] Modificar danos das armas!
#1

Olhei alguns tutoriais e outros Post's de ajuda mas nenhum me mostrou como modificar.

O codigo:
PHP код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
 if(
AntiLagOn == true)
    {
            new
                
Float: vida,
                
Float: armadura,
                
Float: dmg;
            
GetPlayerArmour(damagedid, armadura);
            
GetPlayerHealth(damagedid, vida);
            if (
armadura > 0)
            {
                if (
amount > armadura)
                {
                    
dmg = amount - armadura;
                    
vida = vida - dmg;
                    
SetPlayerArmour(damagedid, 0.0);
                    
SetPlayerHealth(damagedid, vida);
                    return 
1;
                }
                
armadura = armadura - amount;
                
SetPlayerArmour(damagedid, armadura);
            }
            if (
armadura < 1)
            {
                
vida = vida - amount;
                
SetPlayerHealth(damagedid, vida);
            }
    }
    return 
1;
} 
Eu quero mudar o dano pois minha eagle tira 46 de dano e a shot 49.
Reply
#2

PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    new 
Float:health;
    if(
issuerid != INVALID_PLAYER_ID)//ISTO VERIFICA SE O JOGADOR Й UM PLAYER VБLIDO E NГO OUTRA COISA
    
{
        if(
weaponid == 38)//MINIGUN
        
{
            
SetPlayerHealth(issuerid, GetPlayerHealth(issuerid, health); - 100);//100 = dano da minigun
        
}
    }
    return 
1;
} 
Reply
#3

Quote:
Originally Posted by HoodScript
Посмотреть сообщение
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    new 
Float:health;
    if(
issuerid != INVALID_PLAYER_ID)//ISTO VERIFICA SE O JOGADOR Й UM PLAYER VБLIDO E NГO OUTRA COISA
    
{
        if(
weaponid == 38)//MINIGUN
        
{
            
SetPlayerHealth(issuerid, GetPlayerHealth(issuerid, health); - 100);//100 = dano da minigun
        
}
    }
    return 
1;
} 
Nгo entendi mano, tem como me dar uma base mais especificada?
Reply
#4

Ora, basta modificar o valor do parвmetro Float:amount.

PHP код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
    switch(
weaponid)
    {
        case 
WEAPON_DEAGLE: amount = 50.0;//altera o damage da eagle para 50
    
}
} 
Reply
#5

Quote:
Originally Posted by Bruno13
Посмотреть сообщение
Ora, basta modificar o valor do parвmetro Float:amount.

PHP код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
    switch(
weaponid)
    {
        case 
WEAPON_DEAGLE: amount = 50.0;//altera o damage da eagle para 50
    
}
} 
Mano, nao funciona

eu queria assim tipo, o dano da eagle = 24, to procurando muito mas nao encontro nada relacionado
Reply
#6

PHP код:
if(weaponid == 24)
{
switch(
bodypart)
{
default: 
amount = 29.1;
} 
Reply
#7

Eu fiz esse code agora, mas mesmo assim o dano continua o mesmo...

oq eu posso fazeR?
PHP код:
}
public 
OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    if(
AntiLagOn == true)
    {
        new
        
Float: vida,
        
Float: armadura,
        
Float: dmg;
        
GetPlayerArmour(damagedid, armadura);
        
GetPlayerHealth(damagedid, vida);
        if(
weaponid == 24){amount = -24;}//eagle
        
if(weaponid == 23){amount = -10;}//silencedcolt
        
if (armadura > 0)
        {
            if (
amount > armadura)
            {
                
dmg = amount - armadura;
                
vida = vida - dmg;
                
SetPlayerArmour(damagedid, 0.0);
                
SetPlayerHealth(damagedid, vida);
                return 
1;
            }
            
armadura = armadura - amount;
            
SetPlayerArmour(damagedid, armadura);
        }
        if (
armadura < 1)
        {
            
vida = vida - amount;
            
SetPlayerHealth(damagedid, vida);
        }
    }
    return 
1;
} 
Reply
#8

Ajudem-me
Reply
#9

pega essa base

SNIPER -- TIRO NA CABEЗA
Код:
#define BODY_PART_TORSO (2)
#define BODY_PART_LEFT_LEG  (7)
#define BODY_PART_RIGHT_LEG (8)
#define BODY_PART_HEAD      (9)
PHP код:
 if(bodypart == BODY_PART_HEAD && weaponid == 34)
            {
                if(
issuerid == INVALID_PLAYER_ID && playerid == INVALID_PLAYER_ID) return 0;

                    
SetPlayerHealth(playerid,0.0);
                    
GameTextForPlayer(issuerid, "~r~~h~Head shot!", 3000, 3);
                    
SendClientMessage(playerid,-1,""COL_GREY" You were killed by a headshot!");
                } 
Reply
#10

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        new Float:amount2;
        switch(weaponid)
        {
            case 24: amount2 = 24.0; //Desert Eagle
            case 23: amount2 = 10.0; //Silenced Colt
        }
        new Float:health, Float:armour;
        GetPlayerHealth(playerid, health);
		GetPlayerArmour(playerid, armour);
		if(armour > 0)
		{
			if(armour - amount2 >= 0)
            {
                SetPlayerArmour(playerid, armour - amount2);
			}
			else
			{
			    SetPlayerArmour(playerid, 0);
			    SetPlayerHealth(playerid, health + (armour - amount2));
			}
		}
		else
		{
		    SetPlayerHealth(playerid, health - amount2);
		}
    }
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)