Weapons, Weapons, Weapons.
#1

I'm doing a zombie/survivors GameMode and I was thinking about giving the zombies
brass knuckles..only if I can make the brass knuckles do more damage than usual.

Is this even possible?


If not, is there any alternitives I can have, to making the zombies stronger than just
simply punching? Because I don't want them running around with m16's..I want to keep
it realistic.


Thank you.
Reply
#2

I would say do check if a player loses damage and if a member of the zombie team is within distance to hit him you could double the damage or kill the player.
Reply
#3

I just want to zombies to be able to kill a survivor in 2 or so hits?
I'm not quite sure how to go about doing this, though.
Reply
#4

Here you can change the health damage

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
forward Float:GetDistanceBetweenPlayers(p1,p2);

forward GetClosestPlayer(p1);

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_FIRE)
    {
        if(GetPlayerWeapon(playerid) == 1) // Brass Knuckles id 1
        {
            new victimid = GetClosestPlayer(playerid);
            if(IsPlayerConnected(victimid))
            {
                if(GetDistanceBetweenPlayers(playerid,victimid) < 2) // distance between the player aka zombie hits
                {
                    new Float:health;
                    GetPlayerHealth(victimid, health);
                    SetPlayerHealth(victimid, health - 20.0); // takes away 20 hp on hit
                    return 1;
                }
            }
        }
    }
    return 1;
}

public Float:GetDistanceBetweenPlayers(p1,p2)
{
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
    {
        return -1.00;
    }
    GetPlayerPos(p1,x1,y1,z1);
    GetPlayerPos(p2,x2,y2,z2);
    return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}

public GetClosestPlayer(p1)
{
    new x,Float:dis,Float:dis2,player;
    player = -1;
    dis = 99999.99;
    for (x=0;x<MAX_PLAYERS;x++)
    {
        if(IsPlayerConnected(x))
        {
            if(x != p1)
            {
                dis2 = GetDistanceBetweenPlayers(x,p1);
                if(dis2 < dis && dis2 != -1.00)
                {
                    dis = dis2;
                    player = x;
                }
            }
        }
    }
    return player;
}
Reply
#5

Oooh, thank you alot!

I'll get working on this after I figure out this damn scoreboard. >_>
Everything works right, I just can't get it to appear on the screen?
I'll post another topic to keep this one OT ;]
Reply
#6

Quote:
Originally Posted by BJaxx
Посмотреть сообщение
Oooh, thank you alot!

I'll get working on this after I figure out this damn scoreboard. >_>
Everything works right, I just can't get it to appear on the screen?
I'll post another topic to keep this one OT ;]
glad i helped.
Reply
#7

Quote:
Originally Posted by Kitten
Посмотреть сообщение
glad i helped.
;] Just tested it and it works like a charm.

Made it even easier that you put the //how much damage the zombie will do
;] I woulda been stuck on that for hours.

Thanks again xD

One thing left before I start mapping ^^
Reply
#8

Just saying, Theres a more efficient way of making this.
Reply
#9

o_O well for the most part, I got the scoreboard to show

SURVIVORS
ZOMBIES

But no scores.. >_> Might fix that later, i dunno.
It's all compiling right, I just can't test it since I
can't host for some odd reason. :\
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)