Damge Increase problem
#1

I want to increase the damage in OnPlayerTakeDamage
So i know How to increase it, But when the player get kill, killerid won't get the score and kill

So i have done some coding in OnPlayerTakeDamage to give kill
and put the codes in last in OnPlayerTakeDamge
But it is not working

Код:
new Float:hp;
GetPlayerHealth(playerid, hp)
if(hp <= 0)
{
    SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
}
Reply
#2

Try doing it with OnPlayerGiveDamage and see if you get the same result.
Reply
#3

Move your codes to OnPlayerDeath , that should work and you don't have to check if the player health lower than 0 this function used when the player death ( when his health equal too 0 then that's automatically check instead of checking every damage if his health equal 0 ) just use something like that
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    return 1;
}
PS: Sorry for editing!
Reply
#4

Try To Learn From Here

+ u don't need that code to check the player is dead, just paste those +1 score thing under OnPlayerDeath
Reply
#5

lol i am not that much newbie ok!
first of all read it again
i have increase the damage amount in OnPlayerTakeDamage, So player get kill by that increase damage amount
when player killed by that damage amount, issuerid(OnPlayerTakeDamage) can't become killerid(OnPlayerDeath)
So the player wont get the score

And I am not that much of stupid
Reply
#6

Quote:
Originally Posted by Iron3man
Посмотреть сообщение
lol i am not that much newbie ok!
first of all read it again
i have increase the damage amount in OnPlayerTakeDamage, So player get kill by that increase damage amount
when player killed by that damage amount, issuerid(OnPlayerTakeDamage) can't become killerid(OnPlayerDeath)
So the player wont get the score

And I am not that much of stupid
If you're not that newbie why don't you do it yourself ? You posted here because you need help and we're trying to.

Anyway why don't you set a variable when you increase the damage then If the player died check if that variable is true and do the rest of your codes ?

Here's an example
pawn Код:
new bool:IncreasedDamge[MAX_PLAYERS];
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID) // If not self-inflicted
    {
        //INCREASE DAMAGE
        IncreasedDamge[playerid] == true;
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(IncreasedDamge[playerid])
    {
        //Do what you want.
        IncreasedDamge[playerid] = false;
    }

    return 1;
}
Reply
#7

Well i think that this is the section for helping scripters and asking their problem

I didn't know that this section is only for newbies scripter. Thanks for telling me.

And I have made a complete TDM server by me only
And now i am a scripter of a community and making a Counter Strike server.
And Do one more favor to me. Pls open a site where scripter like me can ask for help..

About the idea i will say that is a nice idea. I am trying the idea.
Reply
#8

Quote:
Originally Posted by Iron3man
Посмотреть сообщение
Well i think that this is the section for helping scripters and asking their problem

I didn't know that this section is only for newbies scripter. Thanks for telling me.

And I have made a complete TDM server by me only
And now i am a scripter of a community and making a Counter Strike server.
And Do one more favor to me. Pls open a site where scripter like me can ask for help..

About the idea i will say that is a nice idea. I am trying the idea.
No one said you're a newbie, You're the first one who said that..
Everyone was a newbie and everyone needs help sometimes.. but when someone tries to help you should appreciate it
Reply
#9

Well i never show disrespect to anyone. If anyone not respect me then i will also not respect him.

And your idea helped me alot thanks for it.

Why don't we become friends!
If u have a skype name then add me nitesh.ironman

And one more question, Is there anyway to remove the Healthbar and Armourbar?
Reply
#10

That's the only way I know..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)