Detect Damage
#1

Hello, how to make that you see the Damage when you shoot an player as a gametext for example: "DAMAGE GIVEN: DAMAGE"?
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage
Reply
#3

Yeah but how to put it then in the gametext like "DAMAGE GIVEN: DAMAGE"
Reply
#4

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
new str[128];
format(str,sizeof(str),"%.2f", amount);
GameTextForPlayer(playerid,str, 5, 1000);
}
Reply
#5

This dont work, know everyone an other solution or should i use for that OnPlayerGiveDamage?
Reply
#6

What about it doesn't work? The code jamesbond007 posted looks perfectly fine to me.
Reply
#7

But will it send that to the ID who got damage, or to the ID which give damage?
Reply
#8

Not to come off absurdly rude, but if you cannot figure that out by looking at the callback parameters and the parameters you pass to the function, I don't think you should be running a server.

Look on the Wiki for their documentation if you need further assistance (one link was already posted).
Reply
#9

I know how to run a server, i just ask for help, so that i will be better in scripting, btw will this code work?

Код:
    if(team[issuerid] == TEAM_HUMAN)
    {
    new Float:hpp;
    GetPlayerHealth(playerid,hpp);
    new str[228];
    format(str,sizeof(str),"~n~~n~~n~~n~~n~~w~ DAMAGE GIVEN: ~g~%.2f ~n~ ~w~PLAYER HP: ~g~%.2f", amount,hpp);
    GameTextForPlayer(issuerid,str, 5, 2000);
    }
I will that it only send it when it is the Player Player who shot and when he is in Human Team.
Reply
#10

pawn Код:
new str[120];
    format(str, sizeof(str),"You just did %.0f damage!", amount);
    SendClientMessage(issuerid, -1, str);
This should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)