Reload after one shot.
#1

Hello, I need some help.

When I shoot with a country rifle (Weapon ID 33), I want to make a reload animation after the shot. When the animation is over the player will be able to shoot once again, and reload and then shoot and so on.

I was trying it with OnPlayerKeyStateChange, but I failed somehow.

Could someone provide me the code with an explanation?

Thanks in advance!
Reply
#2

Try that not sure about that animation but i will test it.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_FIRE)//If he clicked LCTRL / LMB (Left Mouse Button)
    {
        if(GetPlayerWeapon(playerid) == 33)//if he got country rifle
        {
        ApplyAnimation(playerid,"BUDDY","buddy_reload",4.1,1,1,1,1,1000,1);//applying animation with time (1 second)
        }
    }
    return 1;
}
Reply
#3

Looking good, also makes sense.

REP+!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)