Confused
#1

Hello,

I'm either being retarded or there's error in my script somewhere. But when ever a player shots another player with any gun/weapon do damage is given. Do I have to add each weapon and damage to "OnPlayerGiveDamage" or "OnPlayerTakeDamage"? I.m kinda confused :S
Reply
#2

you can download a filterscript that will make players loose health when they gets shots
Reply
#3

I never use filterscripts. Don't see the point in them.
Reply
#4

than you can add that to your script :

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID// If not self-inflicted
    
{
        new
            
infoString[128],
            
weaponName[24],
            
victimName[MAX_PLAYER_NAME],
            
attackerName[MAX_PLAYER_NAME];
 
        
GetPlayerName(playeridvictimNamesizeof (victimName));
        
GetPlayerName(issueridattackerNamesizeof (attackerName));
 
        
GetWeaponName(weaponidweaponNamesizeof (weaponName));
 
        
format(infoStringsizeof(infoString), "%s has made %.0f damage to %s, weapon: %s"attackerNameamountvictimNameweaponName);
        
SendClientMessageToAll(-1infoString);
    }
    return 
1;

Reply
#5

I have already tried this, but somehow the victim dosen't loss any health what so ever
Reply
#6

do you have any errors when you compile ?
Reply
#7

For me, It's more likely you have SetPlayerTeam used to set players in same team? If they are in same team, they won't be able to hit each other.
Reply
#8

Nope, No errors at all.
EDIT: I have SetPlayerTeam(..) For all my classes at different numbers, Civilian: 1 Police: 2 and so on.

EDIT 2: It was SetPlayerTeam(..), but I had it so Civilians cant kill each other some how..

EDIT 3: Fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)