All pastes #585548 Raw Edit

Miscellany

public lua v1 · immutable
·published 2007-06-23 09:44 UTC
rendered paste body
--project by blackbird and paradoxDeriveGamemode("sandbox")AddCSLuaFile("cl_init.lua")AddCSLuaFile("shared.lua")start = {}start.money = 100start.job = "unemployed"start.team = 10start.wm = "Welcome to Paradox RP!"start.paydaytimer = 1800start.weapons = { "weapon_physcannon", "weapon_physgun" }function FirstSpawn( ply )  	ply:SetNWInt("money", start.money)	ply:SetNWString("job", start.job)	ply:SetTeam(start.team)	ply:PrintMessage(HUD_PRINTCENTER, start.wm);	timer.Simple(start.paydaytimer,Payday,ply)end hook.Add( "PlayerInitialSpawn", "playerInitialSpawn", FirstSpawn);function playerRespawn( ply )   	PrintTable(start.weapons)	for key,value in pairs(start.weapons) do		print(key)--this will print 1 and 2		print(value)-- this will print weapon_physcannon then weapon_physgun		ply:Give(value)	end end hook.Add( "PlayerSpawn", "playerRespawnTest", playerRespawn );  function playerchat( ply, text, teamsay )	local chatbl = string.Explode(" ",text) 	if string.find(text,"/setjob") then 		ply:SetNWString("job",chatbl[2])	end end hook.Add( "PlayerSay", "playerSaid", playerSaid ); function Payday(ply)        ply:SetNWInt("money",ply:GetNWInt("money")+50)        timer.Simple(start.paydaytimer,Payday,ply)end function savestuff(ply)        local steamid = ply:SteamID()        local name = ply:Nick()        local money = ply:GetNWInt("money")        local job = ply:GetNWString("job")        file.Write("rpsave/"..name..":"..steamid.."".txt", money.."\n"..job)end