OnPlayerOnShoot.
#1

I have this code :
pawn Код:
format(string,sizeof(string),"~n~~n~~w~You hit ~r~%s ~w~Damage:~r~ %i ~w~Weapon:~r~%s",TargetName,floatround(HealthLost+ArmourLost),wepname);
    GameTextForPlayer(Shooter,string,3000,5);
But it won't show how much damage I've done from far, anyway to do it ?
Reply
#2

Someone ?
Reply
#3

Bumping...
OFFTOPIC : How to stop PlayerPlaySound ? :\.
Reply
#4

Quote:

b) Do not bump
Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 48 hours old, and it needs to have useful information about your problem.

i dont know the first
to remove the sounds just delete the line which contains "PlayerPlaySound"
Reply
#5

pawn Код:
stock GetDistanceBetween(x1, y1, z1, x2, y2, z2)
{
    new float:dist;
    dist = floatsqroot(floatpower(floatsub(x2, x1), 2) + floatpower(floatsub( y2, y1), 2) + floatpower(floatsub( z2, z1), 2));
    return dist;
}
Reply
#6

Snipa, tell me how to use it... ?
Reply
#7

Place the stock outside any callback, preferably at the bottom.

Get each player's x, y, and z, then use the stock. It returns the distance.
Reply
#8

Uhm.
Will it tell me that If hit the player with a distance of a sniper rifle ?
EDIT:
I think you got me wrong.
pawn Код:
new TargetName[MAX_PLAYER_NAME];
    new ShooterName[MAX_PLAYER_NAME];
    GetPlayerName(Target,TargetName,MAX_PLAYER_NAME);
    GetPlayerName(Shooter,ShooterName,MAX_PLAYER_NAME);
    new gun=GetPlayerWeapon(Shooter);
    new string[128];
    new wepname[30];
    GetWeaponName(gun,wepname,sizeof(wepname));
    format(string,sizeof(string),"~n~~n~~w~You hit ~r~%s ~w~Damage:~r~ %i ~w~Weapon:~r~%s",TargetName,floatround(HealthLost+ArmourLost),wepname);
    GameTextForPlayer(Shooter,string,3000,5);
    format(string,sizeof(string),"~n~~n~~w~You got hit by ~r~%s ~w~Damage:~r~ %i ~w~Weapon:~r~%s",ShooterName,floatround(HealthLost+ArmourLost),wepname);
    GameTextForPlayer(Target,string,3000,5);
This is the code, It tells me that I hit the player, but when I use a sniper rifle, it doesn't show me the damage, because it's too far, I guess.
Reply
#9

Oh, I thought you wanted to find the distance between the shooters, my bad.

So it doesn't show the damage when you shoot with a sniper?
Reply
#10

I shot my friend from far, it didn't tell me how much damage I did, mind testing it with me on my homehost server ?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)