Custom weapon.
#12

Код:
enum E_WEAPON_DATA
{
        // add this little line and you tadaaa you have a custom name!
       wep_CustomName[16], // max name , 8 seems enough aswell.
        wep_BaseWeapon,
Float:  wep_Damage
}
Код:
DefineCustomWeapon(weaponName[], baseweapon, Float:damage)
{
    format(wep_Data[wep_Total][wep_CustomName], 16 or 8 read above, "%s", weaponName);
    wep_Data[wep_Total][wep_BaseWeapon] = baseweapon;
    wep_Data[wep_Total][wep_Damage] = damage;

    return wep_Total;
}

( in the gamemode init : )
DefineCustomWeapon("AK-65" ,30, 20.0); // Some fancy name ( keep it below 16 chars ) or put 32 if you have some loooong name. :3
DefineCustomWeapon("AK-11" ,30, 30.0);
DefineCustomWeapon("AK-xOne" ,30, 100.0); // 100 damage means oneshot
Код:
stock GivePlayerCustomWeapon(playerid, weapontype, ammo)
{
    if(!(0 <= weapontype < wep_Total))
        return 0;

    GivePlayerWeapon(playerid, wep_Data[weapontype][wep_BaseWeapon], ammo);
    new str[128];
    format(str, 128, "You just received a sexy %s", wep_Data[weapontype][wep_CustomName]);
    SendClientMessage(playerid, -1, str);
    return 1;
}
Not tested, hopefully it works. Also, Big thanks to Southclaw, this actually helped me too :3
Reply


Messages In This Thread
Custom weapon. - by Baltimore - 01.03.2015, 21:30
Re : Custom weapon. - by Baltimore - 01.03.2015, 22:18
Re: Custom weapon. - by maramizo - 01.03.2015, 22:58
Re : Custom weapon. - by Baltimore - 02.03.2015, 00:39
Re : Custom weapon. - by Baltimore - 02.03.2015, 10:24
Re : Custom weapon. - by Baltimore - 02.03.2015, 18:35
Re : Custom weapon. - by Golimad - 02.03.2015, 22:16
Re : Custom weapon. - by Baltimore - 02.03.2015, 22:17
Re : Custom weapon. - by Golimad - 02.03.2015, 22:21
Re : Custom weapon. - by Baltimore - 03.03.2015, 11:37
Re : Custom weapon. - by Baltimore - 03.03.2015, 19:55
Re : Custom weapon. - by Golimad - 03.03.2015, 20:22
Re : Custom weapon. - by Baltimore - 04.03.2015, 00:08
Re : Custom weapon. - by Golimad - 04.03.2015, 00:12
Re : Custom weapon. - by Baltimore - 04.03.2015, 01:32
Re : Custom weapon. - by Golimad - 04.03.2015, 21:47
Re : Custom weapon. - by Baltimore - 21.03.2015, 11:35
Re : Custom weapon. - by Baltimore - 22.03.2015, 09:06
Re: Re : Custom weapon. - by JaydenJason - 22.03.2015, 11:03
Re : Custom weapon. - by Baltimore - 22.03.2015, 19:56
Re : Custom weapon. - by Baltimore - 22.03.2015, 20:16
Re: Custom weapon. - by arjanforgames - 22.03.2015, 21:22
Re : Re: Custom weapon. - by Baltimore - 22.03.2015, 21:39
Re : Custom weapon. - by Baltimore - 28.03.2015, 09:31
Re : Custom weapon. - by Baltimore - 28.03.2015, 10:38
Re : Custom weapon. - by Baltimore - 28.03.2015, 14:34
Re : Custom weapon. - by Baltimore - 28.03.2015, 14:54
Re : Custom weapon. - by Baltimore - 28.03.2015, 20:28
Re : Custom weapon. - by Baltimore - 06.04.2015, 08:46
Re: Custom weapon. - by Baltimore - 02.05.2015, 17:12

Forum Jump:


Users browsing this thread: 1 Guest(s)