SHARE
TWEET

Untitled

a guest Aug 12th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local MIXTURE = {};
  2.  
  3. MIXTURE.ID = 'entity_pot_plant';
  4. MIXTURE.Name = 'Entity: Cannabis Plant';
  5. MIXTURE.Requires = {'drug_pot_seeds', 'item_pot'};
  6. MIXTURE.Produces = 'pot';
  7. MIXTURE.Produces_Text = 'Cannabis plant which produces marijuana and seeds.';
  8. MIXTURE.RequiredSkills = {{skill = 'Intelligence', level = 1}};
  9.  
  10. // MIXTURE.HowTo = 'test how to\ntest';
  11.  
  12. function MIXTURE.CanMix ( MixturePosition, Player )
  13.     local NumDrugs = 0;
  14.     for k, v in pairs(ents.FindByClass('pot')) do
  15.         if v:GetTable().ItemSpawner == Player then
  16.             NumDrugs = NumDrugs + 1;
  17.         end
  18.     end
  19.    
  20.     if NumDrugs >= 8 then
  21.         Player:Notify('You have hit the maximum number of pot plants allowed.');
  22.         return false;
  23.     end
  24.    
  25.     if Player:IsGovernmentOfficial() then
  26.         Player:Notify('You cannot do this as a government official!');
  27.         return false;
  28.     end
  29.  
  30.    
  31.     return true;
  32. end
  33.  
  34. GM:RegisterMixture(MIXTURE);
RAW Paste Data
Top