//at the top of scriptnew crate;//under gamemodeintcrate = createobject();/createdynamicobject();CMD:getweapon(playerid,params){ if(IsPlayerInRangeOfPoint(playerid, 7.0, X, Y, Z)) // xyz of the object { GivePlayerWeapon(playerid,weaponid,ammo); //https://sampwiki.blast.hk/wiki/Weapons / Do as many times u want } return 1;}