Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. -- Called just after a player spawns.
  2. function Schema:PostPlayerSpawn(player, lightSpawn, changeClass, firstSpawn)
  3. local clothes = player:GetCharacterData("clothes");
  4. local body = player:GetCharacterData("BodyGroups")
  5.  
  6. if (!lightSpawn) then
  7. player:SetSharedVar("antidepressants", 0);
  8.  
  9. Clockwork.datastream:Start(player, "ClearEffects", true);
  10.  
  11. player.beingSearched = nil;
  12. player.searching = nil;
  13.  
  14. if (self:PlayerIsCombine(player) or player:GetFaction() == FACTION_ADMIN) then
  15. if (player:GetFaction() == FACTION_OTA) then
  16. player:SetMaxHealth(200);
  17. player:SetMaxArmor(200);
  18. player:SetHealth(200);
  19. player:SetArmor(200);
  20. if Schema:IsPlayerCombineRank(player,"EOW") then
  21. player:SetMaxHealth(250)
  22. player:SetMaxArmor(250)
  23. player:SetHealth(250)
  24. player:SetArmor(250)
  25. end
  26. else
  27. if player:Team() != CLASS_RACP then
  28. player:SetMaxArmor(120)
  29. player:SetArmor(120)
  30. else
  31. player:SetMaxArmor(255)
  32. player:SetArmor(255)
  33. end
  34. end
  35. end;
  36.  
  37. if string.find(player:GetName(),"Dmitry Kartograf 'Pahan'") then
  38. player:SetMaxHealth(120)
  39. player:SetHealth(120)
  40. player:SetMaxArmor(180)
  41. player:SetArmor(180)
  42. end
  43.  
  44. if (self:PlayerIsCombine(player) and player:GetAmmoCount("pistol") == 0) then
  45. if (!player:HasItemByID("ammo_pistol")) then
  46. player:GiveItem(Clockwork.item:CreateInstance("ammo_pistol"), true);
  47. player:GiveItem(Clockwork.item:CreateInstance("ammo_pistol"), true);
  48. end;
  49. end;
  50. end;
  51.  
  52. if (self:IsPlayerCombineRank(player, "SCN")) then
  53. self:MakePlayerScanner(player, true, lightSpawn);
  54. else
  55. self:ResetPlayerScanner(player);
  56. end;
  57.  
  58. if (player:GetSharedVar("tied") != 0) then
  59. self:TiePlayer(player, true);
  60. end;
  61.  
  62. if (clothes) then
  63. local itemTable = Clockwork.item:FindByID(clothes);
  64.  
  65. if (itemTable and player:HasItemByID(itemTable.uniqueID)) then
  66. self:PlayerWearClothes(player, itemTable);
  67. else
  68. player:SetCharacterData("clothes", nil);
  69. end;
  70. end;
  71.  
  72. --[[
  73. if body and type(body) == "table" then
  74. for k, v in pairs( body ) do
  75. for z, x in pairs( v ) do
  76. player:SetBodygroup( z, x )
  77. end
  78. end
  79. else
  80. for k,v in pairs( player:GetBodyGroups() ) do
  81. player:SetBodygroup( v.id, 0 )
  82. end
  83. end
  84. ]]
  85.  
  86. if !Schema:IsCombineFaction(player:GetFaction()) then
  87. if !player:GetCharacterData("forcefieldaccess") then
  88. player:SetCharacterData("forcefieldaccess",0)
  89. player:SetNWInt( "ffaccess", 0 )
  90. end
  91. else
  92. player:SetCharacterData("forcefieldaccess",1)
  93. player:SetNWInt( "ffaccess", 1 )
  94. end
  95. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement