Create multiple weapons on one M4?
#6

Quote:
Originally Posted by Inuro
Посмотреть сообщение
And to give the weapon a player, I use this
pawn Код:
GivePlayerWeapon(playerid, M4_AN94, 500)
Or it is something else?


And to identify the damage
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    new Float:HP;
    GetPlayerHealth(playerid, HP);
    if(M4_AN94 == 1) SetPlayerHealth(playerid, HP-44);
    return 1;
}
No, just give the M4, but set the M4Mode to 'M4_AN94', example:
pawn Код:
GivePlayerWeapon(playerid, WEAPON_M4, 500);
M4Mode[ playerid ] = M4_AN94;
About the Damage part, do the "switch-checks" again;
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    new Float:HP;
    GetPlayerHealth(playerid, HP);
    if(weaponid == WEAPON_M4) //if the weapon was M4
    {
        switch(M4Mode[ issuerid ]) //switch-checks for the m4 mode
        {
            case M4_AN94: SetPlayerHealth(playerid, HP-44); //if its an-94, take 44dmg
            case M4_CAR15: SetPlayerHealth(playerid, HP-32); //if its car-15, take 32dmg
            case M4_STEYRAUG: SetPlayerHealth(playerid, HP-38); //if its steyr-aug, take 38dmg
        }
    }
    return 1;
}
Reply


Messages In This Thread
Create multiple weapons on one M4? - by Inuro - 02.12.2014, 15:50
Re: Create multiple weapons on one M4? - by Kyance - 02.12.2014, 16:29
Re : Create multiple weapons on one M4? - by Inuro - 02.12.2014, 16:35
Re: Re : Create multiple weapons on one M4? - by Kyance - 02.12.2014, 16:42
Re : Create multiple weapons on one M4? - by Inuro - 02.12.2014, 16:50
Re: Re : Create multiple weapons on one M4? - by Kyance - 02.12.2014, 16:54
Re : Create multiple weapons on one M4? - by Inuro - 02.12.2014, 16:56
Re: Re : Create multiple weapons on one M4? - by Kyance - 02.12.2014, 16:57
Re : Create multiple weapons on one M4? - by Inuro - 02.12.2014, 17:00
Re: Re : Create multiple weapons on one M4? - by Kyance - 02.12.2014, 17:01

Forum Jump:


Users browsing this thread: 1 Guest(s)