SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 12/03/2011, 10:10 PM   #1
BlackWolf120
Gangsta
 
BlackWolf120's Avatar
 
Join Date: Nov 2010
Location: Germany
Posts: 761
Reputation: 50
Question Weapon damage!!

hi,

im using the OnPlayerShootPlayer include with this code in my gamemode:

pawn Code:
public OnPlayerShootPlayer(shooter,target,Float:damage)
{
    new Float:H[2];
    GetPlayerHealth(target, H[0]);
    GetPlayerArmour(target,H[1]);
    if(GetPlayerWeapon(shooter) == 34)//this is a sniper
    {
        if(H[1] > 0) return SetPlayerArmour(target,0);
        SetPlayerHealth(target, H[0]-100);
    }
    return 1;
}
I want that u die instantly if hit by a sniper, no matter how much life or armor u got.
This works just perfectly as long as i shoot a player from a low distance.
As soon as a shoot a player from a longer distance it does not work anymore.
Could someone pls help me? PLs tell me what could be the problem.

regards, BlackWolf120.
__________________
BlackWolf120 is offline  
Old 12/03/2011, 11:39 PM   #2
Tommy_Mandaz
Huge Clucker
 
Join Date: Jun 2009
Posts: 273
Reputation: 0
Default Re: Weapon damage!!

Maybe try to make it simple like this:

Code:
if(GetPlayerWeapon(shooter) == 34)
{
SetPlayerHealth(target, 0);
SetPlayerArmour(target, 0);
}
return 1;
}
Tommy_Mandaz is offline  
Old 13/03/2011, 12:05 AM   #3
BlackWolf120
Gangsta
 
BlackWolf120's Avatar
 
Join Date: Nov 2010
Location: Germany
Posts: 761
Reputation: 50
Question Re: Weapon damage!!

hi,
thx for ur answer.
This would really work?
__________________
BlackWolf120 is offline  
Old 13/03/2011, 12:14 AM   #4
[WF]Demon
Huge Clucker
 
[WF]Demon's Avatar
 
Join Date: Oct 2009
Posts: 484
Reputation: 3
Default Re: Weapon damage!!

The distance for OnPlayerShootPlayer is measured in the include, you need to increase that distance, I'm not sure how to do this as i have no idea what that include looks like.
[WF]Demon is offline  
Old 13/03/2011, 12:27 AM   #5
BlackWolf120
Gangsta
 
BlackWolf120's Avatar
 
Join Date: Nov 2010
Location: Germany
Posts: 761
Reputation: 50
Question Re: Weapon damage!!

mhh, would be great if someone could tell me how to increase the distance
heres the inlcude on pastebin: http://pastebin.com/tDxSPhqA
would be very happy about an answer
__________________
BlackWolf120 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Real Weapon Damage 1.1 .LaaRs. Filterscripts 17 28/07/2012 11:00 AM
Modifying weapon damage? Zack9764 Help Archive 16 16/02/2011 04:36 AM
Help Weapon Damage ahmet257 Help Archive 14 13/09/2010 04:39 PM
Weapon Damage Scarface~ Help Archive 4 27/08/2010 07:05 PM
Weapon damage vection Help Archive 7 23/08/2010 09:11 AM


All times are GMT. The time now is 01:14 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.