daily pastebin goal
35%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. Name: "sh_prisonguard.lua".
  3. Product: "".
  4. --]]
  5.  
  6. local FACTION = {};
  7.  
  8. FACTION.whitelist = true;
  9. FACTION.models = {
  10.     female = {"models/Combine_Soldier_PrisonGuard.mdl"},
  11.     male = {"models/Combine_Soldier_PrisonGuard.mdl"}
  12. };
  13.  
  14. -- Called when a player's name should be assigned for the faction.
  15. function FACTION:GetName(player, character)
  16.     local unitID = math.random(1, 99999);
  17.    
  18.     return "OTA-ECHO.OWPG-"..NEXUS:ZeroNumberToDigits(unitID, 5);
  19. end;
  20.  
  21. -- Called when a player's model should be assigned for the faction.
  22. function FACTION:GetModel(player, character)
  23.     if (character.gender == GENDER_MALE) then
  24.         return self.models.male[1];
  25.     else
  26.         return self.models.female[1];
  27.     end;
  28. end;
  29.  
  30. -- Called when a player is transferred to the faction.
  31. function FACTION:OnTransferred(player, faction, name)
  32.     if (faction.name == FACTION_MPF) then
  33.         nexus.player.SetName(player, string.gsub(player:QueryCharacter("name"), ".+(%d%d%d%d%d)", "OTA-ECHO.OWPG-%1"), true);
  34.     else
  35.         nexus.player.SetName(player, self:GetName( player, player:GetCharacter() ), true);
  36.     end;
  37.    
  38.     if (player:QueryCharacter("gender") == GENDER_MALE) then
  39.         player:SetCharacterData("model", self.models.male[1], true);
  40.     else
  41.         player:SetCharacterData("model", self.models.female[1], true);
  42.     end;
  43. end;
  44.  
  45. FACTION_OTA = nexus.faction.Register(FACTION, "Overwatch Prison Guard");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top