SA-MP Forums Archive
Keeping the gun with no ammo??? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Keeping the gun with no ammo??? (/showthread.php?tid=225006)



Keeping the gun with no ammo??? - [MNC]Azz - 12.02.2011

Soooo... Yeah...
I wanted to know if there is a function or a way or is it even possible
to keep the weapon after finishing the ammo?

Plz help...

Regards....


Re: Keeping the gun with no ammo??? - Hash [NL-RP] - 12.02.2011

Impossible


Re: Keeping the gun with no ammo??? - jesse237 - 12.02.2011

AttachObjectToPlayer

Maybe?


Re: Keeping the gun with no ammo??? - Shadow™ - 13.02.2011

pawn Код:
new GunObjectIDs[200] ={

   1575,  331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325, 326, 342, 343, 344, -1,  -1 , -1 ,
   346, 347, 348, 349, 350, 351, 352, 353, 355, 356, 372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367,
   368, 369, 1575 , 1575 , 1575 , 1575 , 1575 , 1575 , 1575 , 1575 , 1575 ,
};

stock GetGunObjectID(wepID)
{
    if (wepID < 0 || wepID > 64)
    {
        return 1575;
    }
    return GunObjectIDs[wepID];
}
then use OnPlayerKeyStateChange to detect if he pressed KEY_FIRE and == 1 ammo then create an object and attach it to the players hand? Not sure on the offset as it would differ with the skins.


Re: Keeping the gun with no ammo??? - [MNC]Azz - 21.02.2011

Thx for the advice.... its not rly wt i wanted but still.... now i knw its impossible xD