All pastes #264651 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-12-02 16:41 UTC
rendered paste body
function transfercash(userid,command,args)
	local tr = util.GetPlayerTrace( userid, userid:GetCursorAimVector() )
	local trace = util.TraceLine( tr )
	if (!trace.Hit) then return end
		if (!trace.HitNonWorld) then return end
			if (trace.Entity:IsPlayer()) then
				if tonumber(userid:GetTable().money)>tonumber(args[1]) and tonumber(args[1])>0 then
	local recieve=trace.Entity:Nick()
	local give=userid:Nick()
	trace.Entity:GetTable().money=trace.Entity:GetTable().money+tonumber(args[1])
	trace.Entity:SetNetworkedString("job",userid:GetTable().job)
	trace.Entity:ChatPrint(args[1].." recieved from "..give)
	//userid:SendLua([[notifyx(args[1].." recieved from "..give,NOTIFY_ERROR)]])
	userid:GetTable().money=userid:GetTable().money-tonumber(args[1])
	userid:SetNetworkedString("job",userid:GetTable().job)
	userid:ChatPrint(args[1].." given to "..recieve)
	//userid:SendLua([[notifyx(args[1].." given to "..recieve,NOTIFY_ERROR)]])
				else
	userid:ChatPrint("You can not give that much.")
	userid:SendLua([[notifyx("You can not afford to give that much.",NOTIFY_ERROR)]])
			end
		end
	
end
concommand.Add( "give_money",transfercash)