Advanced weapons. -
SilencedPistol - 16.07.2013
I'm thinking of doing a little system to get myself started in the big scripting things.
The idea is to be able to buy guns and then customise them in a certain way; I know how to do that, and I'm gonna keep that idea for myself until I release the script to show you guys how I've done.
There's something I'm stuck on, however, two things more or less:
Weapon Damage - I've got custom weapon damages for each weapon, the trouble is, it takes away health and if the player has Kevlar & health, it still takes away health only. I want to know how to correct it so it checks if the player has Kevlar, and if they do, it then takes the Kevlar before taking the health.
Weapon Range - Is there a way I could alter the range that weapons can shoot and hit a target without using MapAndreas? I hear it takes up quite a lot of memory so I don't particularly want to use it.
Can I get some help here? Also, ideas are appreciated for customising weapons and stuff.
Re: Advanced weapons. -
arjanforgames - 16.07.2013
For kevlar.
Just use GetPlayerArmor and check if it's more than 1. (>= 1)
If it is you want to subtract a value from his kevlar or else his health.
Re: Advanced weapons. -
Scenario - 16.07.2013
70MB's of RAM is a small price to pay for good accuracy.
However, if you're really that concerned, there's a plugin-version of MapAndreas around here somewhere (not written by Kalcor, though). It's a bit slower obviously, but it won't use as much RAM.
Re: Advanced weapons. -
SilencedPistol - 16.07.2013
So whoch functions do I use to do the things I want to do?
@realcop, big fan of yours.
Re: Advanced weapons. -
SilencedPistol - 17.07.2013
Anything?
Re: Advanced weapons. -
Scenario - 17.07.2013
Sorry, I'm not quite sure as I have no personal experience with MapAndreas. I'm sure someone, somewhere, has released a piece of code though.
Re: Advanced weapons. -
SilencedPistol - 17.07.2013
No, no. I aint using MapAndreas, I'm just wondering if there is a way to adjust the ranges of a weapon in SA:MP. Is there a function or whatever?
Re: Advanced weapons. -
Bakr - 17.07.2013
Use
https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage, check the weaponid and adjust the damage accordingly.
Re: Advanced weapons. -
SilencedPistol - 18.07.2013
I know how to adjust the damage, but, is there a way to adjust the weapon range? Such as...
pawn Код:
new Float:x, Float:y, Float:z;
if(WeaponRange(playerid, 2.0, x, y, z)
{
DAMAGE CODE HERE, ETC
return 1;
}
Like, I want to know if you can adjust the range the weapons shoot. So let's say a deagle shoots 10 meters and deals 10 damage, is there a way to adjust it so that it can only shoot 5 meters? It's a difficult way to phrase it, but I believe it can be done?
Re: Advanced weapons. -
Sasino97 - 18.07.2013
Quote:
Originally Posted by SilencedPistol
I know how to adjust the damage, but, is there a way to adjust the weapon range? Such as...
pawn Код:
new Float:x, Float:y, Float:z; if(WeaponRange(playerid, 2.0, x, y, z) { DAMAGE CODE HERE, ETC return 1; }
Like, I want to know if you can adjust the range the weapons shoot. So let's say a deagle shoots 10 meters and deals 10 damage, is there a way to adjust it so that it can only shoot 5 meters? It's a difficult way to phrase it, but I believe it can be done?
|
To lower the weapon shooting range I'd check the distance between the two players: if they are too distant then give the player some health back and clear animations.