Guest User

Phynix | px_chars/server/config.lua

a guest
Nov 22nd, 2023
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.19 KB | None | 0 0
  1. Config = {
  2.   nameBlacklist = { -- if ANY part of a name contains these characters, it will be rejected, i.e. "fucker", "fatass", "dickhead"
  3.    
  4.   },
  5.   uniqueNamesOnly = true, -- names must be unique, i.e., two characters cannot share the same EXACT name (case insensitive)
  6.   disableSpecialChars = true, -- names cannot contain special characters, e.g. @, !, ^, %, $, etc.
  7.   nameMustContainVowel = true, -- all names must contain a vowel
  8.   consoleOutput = true, -- output debug text to console
  9.  
  10.   charIdentifier = ESX.GetConfig().Identifier or GetConvar('sv_lan', '') == 'true' and 'ip' or "license",
  11.  
  12.   prefix = "char",
  13.  
  14.   -- base locations to spawn in
  15.   baseSpawnLocations = {
  16.     {
  17.       coords = vector4(435.68, -645.97, 28.73, 85.0),
  18.       name = "Los Santos"
  19.     },
  20.     {
  21.       coords = vector4(177.596, 6636.183, 31.638, 130.0),
  22.       name = "Paleto Bay"
  23.     },
  24.     {
  25.       coords = vector4(1501.02, 3776.2, 33.5, 206.0),
  26.       name = "Sandy Shores"
  27.     }
  28.   },
  29.  
  30.   -- if jailed, this will be your only option
  31.   jailSpawn = {
  32.     coords = vector3(1766.39, 2569.34, 45.72),
  33.     name = "Bolingbroke Penitentiary"
  34.   },
  35.  
  36.   -- this function will compute available spawn locations for the player
  37.   spawnCompute = function(src, Player, firstJoin, isJailed)
  38.     local spawnLocations = {};
  39.  
  40.     if not isJailed then
  41.             if not firstJoin then
  42.                 spawnLocations = Utils:CopyTable(Config.baseSpawnLocations);
  43.             elseif not Apartments or not Apartments.Starting then
  44.                 spawnLocations = Utils:CopyTable(Config.baseSpawnLocations);
  45.             end
  46.  
  47.       -- prevent players from spawning at these locations by commenting them
  48.             spawnLocations = Chars:GetHousingLocations(Player, spawnLocations);
  49.             spawnLocations = Chars:GetLastLocation(Player, spawnLocations, firstJoin);
  50.         else
  51.             table.insert(spawnLocations, {
  52.                 name = Config.jailSpawn.name,
  53.                 coords = Config.jailSpawn.coords,
  54.                 isJailed = true
  55.             });
  56.         end
  57.  
  58.     return spawnLocations;
  59.   end,
  60.  
  61.   -- implement your own logic to check if the player is jailed
  62.   isJailed = function(src, xPlayer)
  63.     -- retVal: boolean (true/false)
  64.     return false
  65.   end,
  66.  
  67.   -- allow respawning at last location
  68.   allowRespawnLastLocation = true
  69. }
Add Comment
Please, Sign In to add comment