DarkRP.Player.NewData

From GMod Wiki

Revision as of 12:17, 16 November 2011 by [RV] TJjokerR (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Deletion.pngThis page has been nominated for deletion. Deletion is due within approximately 30 days from nomination, unless the deletion has been disputed on the talk page. See more pages nominated for deletion here.
Reason for deletion: Not what Garry wants the wiki to be used for
Last Edit was made on 11/16/2011
Gamemode Function: DarkRP.Player.NewData
DarkRP.Player.NewData is a function that is defined in the DarkRP Gamemode and its derivatives.
Function
Syntax Player:NewData( )
Where is this used?
Description:
Setup the player when he joins. This shouldn't be used elsewhere.
Returns: nil
Part of Library: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DarkRP.Player.NewData]DarkRP.Player.NewData [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThe function how it's defined in darkrp.
Used onNewerServer.png
Code
function meta:NewData()
	if not ValidEntity(self) then return end
	local function ModuleDelay(ply)
		umsg.Start("LoadModules", ply)
			umsg.Short(#CSFiles)
			for n = 1, #CSFiles do
				umsg.String(CSFiles[n])
			end
		umsg.End()
	end
 
	timer.Simple(.01, ModuleDelay, self)
 
	self:RestoreRPName()
 
	DB.StoreSalary(self, GetConVarNumber("normalsalary"))
 
	self:UpdateJob(team.GetName(1))
 
	self:GetTable().Ownedz = { }
	self:GetTable().OwnedNumz = 0
 
	self:GetTable().LastLetterMade = CurTime() - 61
	self:GetTable().LastVoteCop = CurTime() - 61
 
	self:SetTeam(1)
 
	-- Whether or not a player is being prevented from joining
	-- a specific team for a certain length of time
	for i = 1, #RPExtraTeams do
		if GetConVarNumber("restrictallteams") == 1 then
			self.bannedfrom[i] = 1
		else
			self.bannedfrom[i] = 0
		end
	end
end
OutputN/A


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox