OnPlayerTakeDamage & OnPlayerGiveDamage bug?
#1

I want to make custom damage system but I have an issue. I tried everything - I wanted to make player deathless from everyweapon. It works! But, weaponid 0 always take damage. Why?
Code:

public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
{
new Float:HP;
GetPlayerHealth(damagedid, HP);
SetPlayerHealth(damagedid, HP);
return 1;
}

Tried to make it with OnPlayerTakeDamage but it always first stolen player's HP and restored it back.

// Edit: Sorry, I forgot to say: I'm on lastest 0.3.8 SAMP Version.
Reply
#2

try OnPlayerTakeDamage for only fist.

PHP Code:
public public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
weaponid == 0)
    {
        new 
Float:HP;
        
GetPlayerHealth(playeridHP);
        
SetPlayerHealth(playeridHP);
    }
    return 
1;

Reply
#3

I know! I just tested it! It's SAMP BUG! SetSpawnInfo does not work! Try it! Player will take damage to other players from same team! If I use command:
CMDetteam (playerid, params[])
{
new tid, tm;
if(sscanf(params, "rd", tid, tm))
{
SendClientMessage(playerid, COLOR_WHITE, "/setteam [player] [team]");
return 1;
}
SetPlayerTeam(tid, tm);
return 1;
}
It works and weaponid 0 does not take any damage!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)