damage count
#1

how to count damage and save it in a variable for later use ?
Reply
#2

Count Damage?? what you want to say?

you want to store health and use it for further use? if yes then create a float variable and save it in your system and later load it for your work.

[This forum requires that you wait 240 seconds between posts. Please try again in 97 seconds.]
Reply
#3

I want to store the highest damage did by a player in a variable then show it when the time comes.
Reply
#4

Take a look at this: https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage
Reply
#5

This directly prints the value of the damage. I just want to store it in a variable and print the highest damage did when i want it to be printed.
Reply
#6

pawn Код:
//Make Global Variable
new float:PlayerHealth[MAX_PLAYERS];

Then On A Public Function
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    // Here amount is what it takes by the Killer
    // You can compare PlayerHealth that is global variable and store the amount of taken damage
    // You can do it like this PlayerHealth[playerid] = amount;
    return 1;
}
this should work like this but I am not conformed
Reply
#7

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    PlayerHealth[playerid] = amount;
    // OR
    PlayerHealth[issuerid] = amount;
    return 1;
}
Reply
#8

Player as player will get damage not the killer
Reply
#9

tage mismatch warning.

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    damagedid[playerid] = amount;
    return 1;
}
Reply
#10

Quote:
Originally Posted by Champ
Посмотреть сообщение
tage mismatch warning.

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    damagedid[playerid] = amount;
    return 1;
}
damagedid variable/array should have Float tag because amount has Float tag, I mean this
pawn Код:
new Float:damagedid[MAX_PLAYERS];
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)